home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Tools / Developers / GLOBAL32.BAS < prev    next >
Encoding:
BASIC Source File  |  2002-06-19  |  130.3 KB  |  2,824 lines

  1. Attribute VB_Name = "Module1"
  2. '
  3. '               Visual Basic Declarations of CRPE32.DLL
  4. '               =====================================
  5. '
  6. '       File:         GLOBAL32.BAS
  7. '
  8. '       Author:       Seagate Software Information Management Group, Inc.
  9. '       Date:         15 Apr 92
  10. '
  11. '       Purpose:      This file presents the API to the Crystal Reports
  12. '                     Print Engine DLL (Professional).
  13. '
  14. '       Language:     Visual Basic for Windows
  15. '
  16. '       Copyright (c) 1992 - 1999 Seagate Software Information Management Group, Inc.
  17. '
  18. '       Revisions:
  19. '
  20. '          CCS  15 Apr 92  -  Original Development
  21. '          KYL  12 Jul 92  -  Modified Existing Declarations
  22. '                             Added Missing Declarations
  23. '          KYL  27 Aug 92  -  Converted to CRPE32.DLL
  24. '          CRD  08 Feb 93  -  Added new calls for 2.0 and Global declares for samples
  25. '          CRD  25 Feb 93  -  Added new calls for 2.0 Pro
  26. '          RBC  23 Apr 93  -  Added more new calls, rearranged to match CRPE.H
  27. '          DVA  22 Dec 93  -  Added new calls for 3.0
  28. '          TW   15 Mar 94  -  3.0 call reorganization
  29. '          RS   28 Aug 95  -  32-bit update
  30. '          JEA  12 May 96  -  Revised for 5.0
  31. '                             Added the following Error Codes
  32. '                               PE_ERR_BADSECTIONHEIGHT     = 560
  33. '                               PE_ERR_BADVALUETYPE         = 561
  34. '                               PE_ERR_INVALIDSUBREPORTNAME = 562
  35. '                               PE_ERR_FIELDEXIST           = 563
  36. '                               PE_ERR_NOPARENTWINDOW       = 564
  37. '                               PE_ERR_INVALIDZOOMFACTOR    = 565
  38. '                             Added the Following Constants
  39. '                               PE_WORD_LEN = 2
  40. '                               PE_PF_NAME_LEN = 256
  41. '                               PE_PF_PROMPT_LEN = 256
  42. '                               PE_PF_VALUE_LEN = 256
  43. '                               PE_PF_NUMBER = 0
  44. '                               PE_PF_CURRENCY = 1
  45. '                               PE_PF_BOOLEAN = 2
  46. '                               PE_PF_DATE = 3
  47. '                               PE_PF_STRING = 4
  48. '                               PE_SIZEOF_VARINFO_TYPE
  49. '                               PE_SUBREPORT_NAME_LEN = 128
  50. '                               PE_SIZEOF_SUBREPORT_INFO
  51. '                               PE_PARAMETER_NAME_LEN = 128
  52. '                               PE_SIZEOF_PARAMETER_INFO
  53. '                               PE_SECT_PAGE_HEADER = 2
  54. '                               PE_SECT_PAGE_FOOTER = 7
  55. '                               PE_SECT_REPORT_HEADER = 1
  56. '                               PE_SECT_REPORT_FOOTER = 8
  57. '                               PE_SECT_GROUP_HEADER = 3
  58. '                               PE_SECT_GROUP_FOOTER = 5
  59. '                               PE_SECT_DETAIL = 4
  60. '                             Added the following Structures
  61. '                               PEParameterFieldInfo
  62. '                               PESubreportInfo
  63. '                               PEParameterInfo
  64. '                             Added the following Declarations
  65. '                               PEGetNParameterFields
  66. '                               PEGetNthParameterField
  67. '                               PESetNthParameterField
  68. '                               PEGetNSubreportsInSection
  69. '                               PEGetNthSubreportInSection
  70. '                               PEGetSubreportInfo
  71. '                               PEOpenSubreport
  72. '                               PECloseSubreport
  73. '                               PESetDialogParentWindow
  74. '                               PEEnableProgressDialog
  75. '                               PEGetNPages
  76. '                               PEShowNthPage
  77. '                               PEGetNSections
  78. '                               PEGetSectionCode
  79. '                               PEGetNthParamInfo
  80. '                             Added the following Functions
  81. '                               PE_SECTION_CODE
  82. '                               PE_SECTION_TYPE
  83. '                               PE_GROUP_N
  84. '                               PE_SECTION_N
  85. '          JEA 13 May 96  -  Changed PELogOnServerWithPrivateInfo 2nd parameter from
  86. '                            PrivateInfo As Any to ByVal PrivateInfo As Long
  87. '          JEA 02 Jun 96  -  Added Following Constants
  88. '                              PE_UNCHANGED_COLOR = -2
  89. '                            Added Following Structure Members
  90. '                              PESectionOptions.underlaySection
  91. '                              PESectionOptions.backgroundColor
  92. '          JEA 27 Jun 96  -  Added the Following Constants
  93. '                              PE_SIZEOF_EXPORT_OPTIONS
  94. '                              PE_SIZEOF_GRAPH_DATA_INFO
  95. '                              PE_SIZEOF_GRAPH_TEXT_INFO
  96. '                              PE_SIZEOF_GRAPH_OPTIONS
  97. '                              PE_SIZEOF_JOB_INFO
  98. '                              PE_SIZEOF_PRINT_FILE_OPTIONS
  99. '                              PE_SIZEOF_CHAR_SEP_FILE_OPTIONS
  100. '                              PE_SIZEOF_PRINT_OPTIONS
  101. '                              PE_SIZEOF_SECTION_OPTIONS
  102. '          JEA 08 Jul 96  -  Added reserve members to these structures for alignment:
  103. '                              Type PEPrintFileOptions
  104. '                                  StructSize As Integer   ' initialize to # of bytes in PEPrintFileOptions
  105. '
  106. '                                  UseReportNumberFmt As Integer
  107. '                                  reserved1 As Integer     ' reserved - do not set
  108. '                                  UseReportDateFormat As Integer
  109. '                                  reserved2 As Integer     ' reserved - do not set
  110. '                              End Type
  111. '
  112. '                              Type PECharSepFileOptions
  113. '                                  StructSize As Integer   ' initialize to PE_SIZEOF_CHAR_SEP_FILE_OPTIONS
  114. '
  115. '                                  UseReportNumberFmt As Integer
  116. '                                  reserved1 As Integer     ' reserved - do not set
  117. '                                  UseReportDateFormat As Integer
  118. '                                  reserved2 As Integer     ' reserved - do not set
  119. '
  120. '                                  StringDelimiter As String * 1
  121. '                                  FieldDelimiter As String * PE_FIELDDELIMLEN
  122. '                              End Type
  123. '         JEA 09 Jul 96  -  Changed Jobinfo Structure declaration
  124. '                           from
  125. '                           PEJobInfo
  126. '                               PrintEnded As Integer
  127. '                           PEJobInfo
  128. '                               PrintEnded As Long
  129. '
  130. '         JEA 11 Jul 96  -  Removed declarations for the following calls
  131. '                            PESetLineHeight
  132. '                            PEGetNLinesInSection
  133. '                            PEGetLineHeight
  134. '                            For old code:
  135. '                               PESetLineHeight now calls PESetMinimumSectionHeight
  136. '                               PEGetLineHeight now calls PEGetMinimumSectionHeight
  137. '                               PEGetNLineInSection always returns 1.
  138. '
  139. '                            Changed the DEVMODE argument of the follow calls to As Any
  140. '                               PESelectPrinter
  141. '                               PEGetSelectedPrinter
  142. '          JEA 02 Aug 96  -  Added the following error code:
  143. '                               Global Const PE_ERR_PAGESIZEOVERFLOW = 567
  144. '                               Global Const PE_ERR_LOWSYSTEMRESOURCES = 568
  145. '                         -  Added the following format formula name constants:
  146. '                               Global Const SECTION_VISIBILITY = 58
  147. '                               Global Const NEW_PAGE_BEFORE = 60
  148. '                               Global Const NEW_PAGE_AFTER = 61
  149. '                               Global Const KEEP_SECTION_TOGETHER = 62
  150. '                               Global Const SUPPRESS_BLANK_SECTION = 63
  151. '                               Global Const RESET_PAGE_N_AFTER = 64
  152. '                               Global Const PRINT_AT_BOTTOM_OF_PAGE = 65
  153. '                               Global Const UNDERLAY_SECTION = 66
  154. '                               Global Const SECTION_BACK_COLOUR = 67
  155. '                         -  Added the following function
  156. 'Declare Function PESetSectionFormatFormula Lib "crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal formulaName%, ByVal formulaString$) As Integer
  157. '                         -  Changed structure member from
  158. '                              PESectionOptions.SuppressBlankLines
  159. '                              to PESectionOptions.SuppressBlankSection
  160. '          JEA 07 Aug 96  -  Added Function PEVBGetVersion
  161. '          JEA 09 Aug 96  -  Added Function To re-direct PEGetJobStatus
  162. '                            Changed PEJobInfo.numRecordsRead,
  163. '                                    PEJobInfo.numRecordsSelected,
  164. '                                    PEJobInfo.numRecordsPrinted back to single Longs.
  165. '          JEA 23 Aug 96  -  Added
  166. '                            showArea As Integer
  167. '                            freeFormPlacement As Integer
  168. '                            members to PESectionOptions structure
  169. '          JEA 28 Aug 96  -  Changed the Following Declarations:
  170. '                            Changed
  171. '                            Declare Function PEHasSavedData Lib "crpe32.dll" (ByVal printJob%, HasSavedData%) As Integer
  172. '                            to
  173. '                            Declare Function PEHasSavedData Lib "crpe32.dll" (ByVal printJob%, HasSavedData As Long) As Integer
  174. '                            Changed
  175. '                            Declare Function PEPrintControlsShowing Lib "crpe32.dll" (ByVal printJob%, ControlsShowing%) As Integer
  176. '                            to
  177. '                            Declare Function PEPrintControlsShowing Lib "crpe32.dll" (ByVal printJob%, ControlsShowing As Long) As Integer
  178. '          JEA 07 OCT 96  -  Changed
  179. '                            PEGraphOptions.ShowDataValue
  180. '                            PEGraphOptions.ShowGridLine
  181. '                            PEGraphOptions.VerticalBars
  182. '                            PEGraphOptions.ShowLegend to Longs to match the CRPE32.DLL which
  183. '                            expects 4 Byte BOOLS.
  184. '                            Changed
  185. '                            Global Const PE_SIZEOF_GRAPH_OPTIONS = 5 * PE_WORD_LEN + 2 * 8 + PE_GRAPH_TEXT_LEN
  186. '                            to
  187. '                            Global Const PE_SIZEOF_GRAPH_OPTIONS = PE_WORD_LEN + 2 * 8 + 4 * 4 + PE_GRAPH_TEXT_LEN
  188. '                            to accomodate new longs.
  189. '          CGH 10 OCT 96  -  Changed PEPrintReport window size parameters to Longs to accomadate CW_USEDEFAULT
  190. '          JEA 15 Oct 96  -  Added the following declarations
  191. '                              PESetAreaFormat
  192. '                              PESetAreaFormatFormula
  193. '                              PEGetAreaFormat
  194. '                            Added function to create area codes:
  195. '                              Function PE_AREA_CODE(sectionType%, groupN%) As Integer
  196. '          JEA 04 Nov 96  -  Added constant
  197. '                              PE_SIZEOF_PARAMETER_FIELD_INFO
  198. '          JEA 09 JAN 97  -  Added new naming convention (PE_FFN) for format formula name constants.
  199. '                         -  Added new format formula name constant PE_FFN_SHOW_AREA = 59
  200. '                         -  Added the following constants
  201. '                              Global Const PE_VI_STRING_LEN = 256
  202. '                              Global Const PE_BYTE_LEN = 1
  203. '                              Global Const PE_LONG_LEN = 4
  204. '                              Global Const PE_DOUBLE_LEN = 8
  205. '                              Global Const PE_VI_STRING_LEN = 256
  206. '                              Global Const PE_SIZEOF_VALUE_INFO = 1 * PE_BYTE_LEN + _
  207. '                                                                 15 * PE_WORD_LEN + _
  208. '                                                                  2 * PE_LONG_LEN + _
  209. '                                                                  2 * PE_DOUBLE_LEN + _
  210. '                                                                  1 * PE_VI_STRING_LEN
  211. '                         -  Added the following Type
  212. '                              Type PEValueInfo
  213. '                         -  Added the following declarations
  214. '                              Declare Function PEConvertPFInfoToVInfo...
  215. '                              Declare Function PEConvertVInfoToPFInfo...
  216. '                         -  Added the following Error Codes
  217. '                             Global Const PE_ERR_BADGROUPNUMBER = 570
  218. '                             Global Const PE_ERR_INVALIDNEGATIVEVALUE = 572
  219. '                             Global Const PE_ERR_INVALIDMEMORYPOINTER = 573
  220. '                             Global Const PE_ERR_INVALIDPARAMETERNUMBER = 594
  221. '                             Global Const PE_ERR_SQLSERVERNOTOPENED = 599
  222.  
  223. '          JEA 14 JAN 97  -  Changed
  224. '                              PE_SECTION_TYPE = ((sectionCode) / 1000)
  225. '                                to
  226. '                              PE_SECTION_TYPE = ((sectionCode) \ 1000)
  227. '                                to truncate instead of round.
  228. '                            Changed
  229. '                              PE_SECTION_N = (((sectionCode / 25) Mod 40))
  230. '                                to
  231. '                              PE_SECTION_N = (((sectionCode \ 25) Mod 40))
  232. '                                to truncate instead of round.
  233. '          JEA 31 JAN 97  - Added constant
  234. '                              Global Const PE_PF_REPORT_NAME_LEN = 128
  235. '                         - Added Structure Members
  236. '                              PEParameterFieldInfo.ReportName
  237. '                              PEParameterFieldInfo.needsCurrentValue
  238. '          JEA 29 APR 97  - Added Constant
  239. '                              PE_SIZEOF_WINDOW_OPTIONS
  240. '                              PE_FFN_AREASECTION_VISIBILITY
  241. '                           Added Type
  242. '                              PEWindowOptions
  243. '                           Added Functions
  244. '                              PEGetSectionFormatFormula
  245. '                              PEGetAreaFormatFormula
  246. '                              PEGetWindowOptions
  247. '                              PESetWindowOptions
  248. '          JEA 20 MAY 97  - Added Constants
  249. '                              PE_VI_NUMBER
  250. '                              PE_VI_CURRENCY
  251. '                              PE_VI_BOOLEAN
  252. '                              PE_VI_DATE
  253. '                              PE_VI_STRING
  254. '                              PE_VI_DATETIME
  255. '                              PE_VI_TIME
  256. '                              PE_VI_INTEGER
  257. '                              PE_VI_COLOR
  258. '                              PE_VI_CHAR
  259. '                              PE_VI_LONG
  260. '                              PE_VI_NOVALUE
  261. '                           Added Structure Members
  262. '                              PEWindowOptions.hasPrintSetupButton
  263. '                              PEWindowOptions.hasRefreshButton
  264. '                              PEValueInfo.ignored
  265. '                              PEValueInfo.viLong
  266. '                           Updated Constants
  267. '                              PE_SIZEOF_WINDOW_OPTIONS
  268. '                              PE_SIZEOF_VALUE_INFO
  269. '          JEA 14 JUL 97  - Added Constants
  270. '                              PE_GO_TBN_ALL_GROUPS_UNSORTED
  271. '                              PE_GO_TBN_ALL_GROUPS_SORTED
  272. '                              PE_GO_TBN_TOP_N_GROUPS
  273. '                              PE_GO_TBN_BOTTOM_N_GROUPS
  274. '                              PE_SF_ORIGINAL
  275. '                              PE_SF_SPECIFIED
  276. '                              PE_SIZEOF_GROUP_OPTIONS
  277. '                              PE_SI_APPLICATION_NAME_LEN
  278. '                              PE_SI_TITLE_LEN
  279. '                              PE_SI_SUBJECT_LEN
  280. '                              PE_SI_AUTHOR_LEN
  281. '                              PE_SI_KEYWORDS_LEN
  282. '                              PE_SI_COMMENTS_LEN
  283. '                              PE_SI_REPORT_TEMPLATE_LEN
  284. '                              PE_SIZEOF_REPORT_SUMMARY_INFO
  285. '                              PE_PT_LONGVARCHAR
  286. '                              PE_PT_BINARY
  287. '                              PE_PT_VARBINARY
  288. '                              PE_PT_LONGVARBINARY
  289. '                              PE_PT_BIGINT
  290. '                              PE_PT_TINYINT
  291. '                              PE_PT_BIT
  292. '                              PE_PT_CHAR
  293. '                              PE_PT_NUMERIC
  294. '                              PE_PT_DECIMAL
  295. '                              PE_PT_INTEGER
  296. '                              PE_PT_SMALLINT
  297. '                              PE_PT_FLOAT
  298. '                              PE_PT_REAL
  299. '                              PE_PT_DOUBLE
  300. '                              PE_PT_DATE
  301. '                              PE_PT_TIME
  302. '                              PE_PT_TIMESTAMP
  303. '                              PE_PT_VARCHAR
  304. '                           Added Types
  305. '                              PEGroupOptions
  306. '                              PEReportSummaryInfo
  307. '                           Added Functions
  308. '                              PEGetGroupOptions
  309. '                              PESetGroupOptions
  310. '                              PEGetReportSummaryInfo
  311. '                              PESetReportSummaryInfo
  312. '          ABC 25 Aug 98  - Added Constants
  313. '                              PE_ERR_INVALIDOBJECTFORMATNAME
  314. '                              PE_ERR_INVALIDOBJECTTYPE
  315. '                              PE_ERR_INVALIDGRAPHDATATYPE
  316. '                              PE_ERR_INVALIDSUBREPORTLINKNUMBER
  317. '                              PE_ERR_SUBREPORTLINKEXIST
  318. '                              PE_ERR_BADROWCOLVALUE
  319. '                              PE_ERR_INVALIDSUMMARYNUMBER
  320. '                              PE_ERR_INVALIDGRAPHDATAFIELDNUMBER
  321. '                              PE_ERR_INVALIDSUBREPORTNUMBER
  322. '                              PE_ERR_INVALIDFIELDSCOPE
  323. '                              PE_ERR_FIELDINUSE
  324. '                              PE_ERR_INVALIDPAGEMARGINS
  325. '                              PE_ERR_REPORTONSECUREQUERY
  326. '                              PE_ERR_CANNOTOPENSECUREQUERY
  327. '                              PE_ERR_INVALIDSECTIONNUMBER
  328. '                              PE_ERR_TABLENAMEEXIST
  329. '                              PE_ERR_INVALIDCURSOR
  330. '                              PE_ERR_FIRSTPASSNOTFINISHED
  331. '                              PE_ERR_CREATEDATASOURCE
  332. '                              PE_ERR_CREATEDRILLDOWNPARAMETERS
  333. '                              PE_ERR_CHECKFORDATASOURCECHANGES
  334. '                              PE_ERR_STARTBACKGROUNDPROCESSING
  335. '                              PE_ERR_SQLSERVERINUSE
  336. '                              PE_ERR_GROUPSORTFIELDNOTSET
  337. '                              PE_ERR_CANNOTSETSAVESUMMARIES
  338. '                              PE_ERR_LOADOLAPDATABASEMANAGER
  339. '                              PE_ERR_OPENOLAPCUBE
  340. '                              PE_ERR_READOLAPCUBEDATA
  341. '                              PE_ERR_CANNOTSAVEQUERY
  342. '                              PE_ERR_CANNOTREADQUERYDATA
  343. '                              PE_ERR_MAINREPORTFIELDLINKED
  344. '                              PE_ERR_INVALIDMAPPINGTYPEVALUE
  345. '                              PE_ERR_HITTESTFAILED
  346. '                              PE_ERR_BADSQLEXPRESSIONNAME
  347. '                              PE_ERR_BADSQLEXPRESSIONNUMBER
  348. '                              PE_ERR_BADSQLEXPRESSIONTEXT
  349. '                              PE_ERR_INVALIDDEFAULTVALUEINDEX
  350. '                              PE_ERR_NOMINMAXVALUE
  351. '                              PE_ERR_INCONSISTANTTYPES
  352. '                              PE_ERR_CANNOTLINKTABLES
  353. '                              PE_ERR_CREATEROUTER
  354. '                              PE_ERR_INVALIDFIELDINDEX
  355. '                              PE_ERR_INVALIDGRAPHTITLETYPE
  356. '                              PE_ERR_INVALIDGRAPHTITLEFONTTYPE
  357. '                              PE_ERR_OTHERERROR
  358. '                              PE_ERR_INTERNALERROR
  359. '                              PE_RPTOPT_CVTDATETIMETOSTR
  360. '                              PE_RPTOPT_CVTDATETIMETODATE
  361. '                              PE_RPTOPT_KEEPDATETIMETYPE
  362. '                              PE_SIZEOF_REPORT_OPTIONS
  363. '                              PE_OE_SINGLE_THREADED
  364. '                              PE_OE_MULTI_THREADED
  365. '                              PE_SIZEOF_ENGINE_OPTIONS
  366. '                              PE_PF_EDITMASK_LEN
  367. '                              PE_PF_DATETIME
  368. '                              PE_PF_TIME
  369. '                              PE_PO_REPORT
  370. '                              PE_PO_STOREDPROC
  371. '                              PE_PO_QUERY
  372. '                              PE_SIZEOF_PARAMETER_VALUE_INFO
  373. '                              PE_DT_SQL_STORED_PROCEDURE
  374. '                              PE_FILE_PATH_LEN
  375. '                              PE_FM_AUTO_FLD_MAP
  376. '                              PE_FM_CRPE_PROMPT_FLD_MAP
  377. '                              PE_RI_INCLUDEUPPERBOUND
  378. '                              PE_RI_INCLUDELOWERBOUND
  379. '                              PE_RI_NOUPPERBOUND
  380. '                              PE_RI_NOLOWERBOUND
  381. '                           Added Types
  382. '                              PEReportOptions
  383. '                              PEParameterValueInfo
  384. '                           Modified Types
  385. '                              PESubreportInfo
  386. '                                  Added Members
  387. '                                      NLinks
  388. '                                      IsOnDemand
  389. '                              PEParameterFieldInfo
  390. '                                  Added Members
  391. '                                      MandatoryPrompt
  392. '                                      MinSize
  393. '                                      MaxSize
  394. '                                      EditMask
  395. '                                      isHidden
  396. '                              PEPrintOptions
  397. '                                  Added Member
  398. '                                      outputFileName
  399. '                           Removed Type
  400. '                              PEParameterInfo
  401. '                           Added Functions
  402. '                              PEGetReportOptions
  403. '                              PESetReportOptions
  404. '                              PESetSectionHeight
  405. '                              PEGetSectionHeight
  406. '                              PEGetNSQLExpressions
  407. '                              PEGetNthSQLExpression
  408. '                              PEGetSQLExpression
  409. '                              PESetSQLExpression
  410. '                              PECheckSQLExpression
  411. '                              PEGetNParameterDefaultValues
  412. '                              PEGetNthParameterDefaultValue
  413. '                              PESetNthParameterDefaultValue
  414. '                              PEAddParameterDefaultValue
  415. '                              PEDeleteNthParameterDefaultValue
  416. '                              PEGetParameterMinMaxValue
  417. '                              PESetParameterMinMaxValue
  418. '                              PEGetParameterValueInfo
  419. '                              PESetParameterValueInfo
  420. '                              PEGetNParameterCurrentValues
  421. '                              PEGetNthParameterCurrentValue
  422. '                              PEAddParameterCurrentValue
  423. '                              PEGetNParameterCurrentRanges
  424. '                              PEGetNthParameterCurrentRange
  425. '                              PEAddParameterCurrentRange
  426. '                              PEGetNthParameterType
  427. '                              PEClearParameterCurrentValuesAndRanges
  428. '                              PEVerifyDatabase
  429. '                              PESetFieldMappingType
  430. '                              PEGetFieldMappingType
  431. '                              PEGetAllowPromptDialog
  432. '                              PESetAllowPromptDialog
  433. '                           Removed Functions
  434. '                              PESetMinimumSectionHeight
  435. '                              PEGetMinimumSectionHeight
  436. '                              PEGetNParams
  437. '                              PEGetNthParam
  438. '                              PEGetNthParamInfo
  439. '                              PESetNthParam
  440. '                           For old code:
  441. '                              PESetMinimumSectionHeight now calls PESetSectionHeight
  442. '                              PEGetMinimumSectionHeight now calls PEGetSectionHeight
  443. '                           Modified PEClosePrintJob Sub to a Function to fix an error in the BAS file
  444. ' JWC Feb 23, 1999:
  445. ' Added Consts:
  446. '       PE_ERR_PARAMTYPEDIFFERENT
  447. '       PE_ERR_INCONSISTANTRANGETYPES
  448. '       PE_ERR_RANGEORDISCRETE
  449. '       PE_ERR_NOTMAINREPORT
  450. '       PE_ERR_INVALIDCURRENTVALUEINDEX
  451. '       PE_ERR_LINKEDPARAMVALUE
  452. '       PE_ERR_INVALIDSORTMETHODINDEX
  453. '       PE_ERR_INVALIDGRAPHSUBTYPE
  454. '       PE_ERR_BADGRAPHOPTIONINFO
  455. '       PE_ERR_BADGRAPHAXISINFO
  456. '
  457. '       PE_GC_BYSECOND
  458. '       PE_GC_BYMINUTE
  459. '       PE_GC_BYHOUR
  460. '       PE_GC_BYAMPM
  461. '
  462. '       PE_GC_TYPETIME
  463. '
  464. '       PE_GT_BARCHART
  465. '       PE_GT_LINECHART
  466. '       PE_GT_AREACHART
  467. '       PE_GT_PIECHART
  468. '       PE_GT_DOUGHNUTCHART
  469. '       PE_GT_THREEDRISERCHART
  470. '       PE_GT_THREEDSURFACECHART
  471. '       PE_GT_SCATTERCHART
  472. '       PE_GT_RADARCHART
  473. '       PE_GT_BUBBLECHART
  474. '       PE_GT_STOCKCHART
  475. '       PE_GT_USERDEFINEDCHART
  476. '       PE_GT_UNKNOWNTYPECHART
  477. '
  478. '       PE_GST_SIDEBYSIDEBARCHART
  479. '       PE_GST_STACKEDBARCHART
  480. '       PE_GST_PERCENTBARCHART
  481. '       PE_GST_FAKED3DSIDEBYSIDEBARCHART
  482. '       PE_GST_FAKED3DSTACKEDBARCHART
  483. '       PE_GST_FAKED3DPERCENTBARCHART
  484. '       PE_GST_REGULARLINECHART
  485. '       PE_GST_STACKEDLINECHART
  486. '       PE_GST_PERCENTAGELINECHART
  487. '       PE_GST_LINECHARTWITHMARKERS
  488. '       PE_GST_STACKEDLINECHARTWITHMARKERS
  489. '       PE_GST_PERCENTAGELINECHARTWITHMARKERS
  490. '
  491. '       PE_GST_ABSOLUTEAREACHART
  492. '       PE_GST_STACKEDAREACHART
  493. '       PE_GST_PERCENTAREACHART
  494. '       PE_GST_FAKED3DABSOLUTEAREACHART
  495. '       PE_GST_FAKED3DSTACKEDAREACHART
  496. '       PE_GST_FAKED3DPERCENTAREACHART
  497. '
  498. '       PE_GST_REGULARPIECHART
  499. '       PE_GST_FAKED3DREGULARPIECHART
  500. '       PE_GST_MULTIPLEPIECHART
  501. '       PE_GST_MULTIPLEPROPORTIONALPIECHART
  502. '
  503. '       PE_GST_REGULARDOUGHNUTCHART
  504. '       PE_GST_MULTIPLEDOUGHNUTCHART
  505. '       PE_GST_MULTIPLEPROPORTIONALDOUGHNUTCHART
  506. '
  507. '       PE_GST_THREEDREGULARCHART
  508. '       PE_GST_THREEDPYRAMIDCHART
  509. '       PE_GST_THREEDOCTAGONCHART
  510. '       PE_GST_THREEDCUTCORNERSCHART
  511. '
  512. '       PE_GST_THREEDSURFACEREGULARCHART
  513. '       PE_GST_THREEDSURFACEWITHSIDESCHART
  514. '       PE_GST_THREEDSURFACEHONEYCOMBCHART
  515. '
  516. '       PE_GST_XYSCATTERCHART
  517. '       PE_GST_XYSCATTERDUALAXISCHART
  518. '       PE_GST_XYSCATTERWITHLABELSCHART
  519. '       PE_GST_XYSCATTERDUALAXISWITHLABELSCHART
  520. '
  521. '       PE_GST_REGULARRADARCHART
  522. '       PE_GST_STACKEDRADARCHART
  523. '       PE_GST_RADARDUALAXISCHART
  524. '
  525. '       PE_GST_REGULARBUBBLECHART
  526. '       PE_GST_DUALAXISBUBBLECHART
  527. '
  528. '       PE_GST_HIGHLOWCHART
  529. '       PE_GST_HIGHLOWDUALAXISCHART
  530. '       PE_GST_HIGHLOWOPENCHART
  531. '       PE_GST_HIGHLOWOPENDUALAXISCHART
  532. '       PE_GST_HIGHLOWOPENCLOSECHART
  533. '       PE_GST_HIGHLOWOPENCLOSEDUALAXISCHART
  534. '       PE_GST_UNKNOWNSUBTYPECHART
  535. '
  536. '       PE_GTT_TITLE
  537. '       PE_GTT_SUBTITLE
  538. '       PE_GTT_FOOTNOTE
  539. '       PE_GTT_SERIESTITLE
  540. '       PE_GTT_GROUPSTITLE
  541. '       PE_GTT_XAXISTITLE
  542. '       PE_GTT_YAXISTITLE
  543. '       PE_GTT_ZAXISTITLE
  544. '
  545. '       PE_GTF_TITLEFONT
  546. '       PE_GTF_SUBTITLEFONT
  547. '       PE_GTF_FOOTNOTEFONT
  548. '       PE_GTF_GROUPSTITLEFONT
  549. '       PE_GTF_DATATITLEFONT
  550. '       PE_GTF_LEGENDFONT
  551. '       PE_GTF_GROUPLABELSFONT
  552. '       PE_GTF_DATALABELSFONT
  553. '       PE_FACE_NAME_LEN
  554. '
  555. '       PE_GLP_PLACEUPPERRIGHT
  556. '       PE_GLP_PLACEBOTTOMCENTER
  557. '       PE_GLP_PLACETOPCENTER
  558. '       PE_GLP_PLACERIGHT
  559. '       PE_GLP_PLACELEFT
  560. '
  561. '       PE_GBS_MINIMUMBARSIZE
  562. '       PE_GBS_SMALLBARSIZE
  563. '       PE_GBS_AVERAGEBARSIZE
  564. '       PE_GBS_LARGEBARSIZE
  565. '       PE_GBS_MAXIMUMBARSIZE
  566. '
  567. '       PE_GPS_MINIMUMPIESIZE
  568. '       PE_GPS_SMALLPIESIZE
  569. '       PE_GPS_AVERAGEPIESIZE
  570. '       PE_GPS_LARGEPIESIZE
  571. '       PE_GPS_MAXIMUMPIESIZE
  572. '
  573. '       PE_GDPS_NODETACHMENT
  574. '       PE_GDPS_SMALLESTSLICE
  575. '       PE_GDPS_LARGESTSLICE
  576. '
  577. '       PE_GMS_SMALLMARKERS
  578. '       PE_GMS_MEDIUMSMALLMARKERS
  579. '       PE_GMS_MEDIUMMARKERS
  580. '       PE_GMS_MEDIUMLARGEMARKERS
  581. '       PE_GMS_LARGEMARKERS
  582. '
  583. '       PE_GMSP_RECTANGLESHAPE
  584. '       PE_GMSP_CIRCLESHAPE
  585. '       PE_GMSP_DIAMONDSHAPE
  586. '       PE_GMSP_TRIANGLESHAPE
  587. '
  588. '       PE_GCR_COLORCHART
  589. '       PE_GCR_BLACKANDWHITECHART
  590. '
  591. '       PE_GDP_NONE
  592. '       PE_GDP_SHOWLABEL
  593. '       PE_GDP_SHOWVALUE
  594. '
  595. '       PE_GNF_NODECIMAL
  596. '       PE_GNF_ONEDECIMAL
  597. '       PE_GNF_TWODECIMAL
  598. '       PE_GNF_CURRENCYNODECIMAL
  599. '       PE_GNF_CURRENCYTWODECIMAL
  600. '       PE_GNF_PERCENTNODECIMAL
  601. '       PE_GNF_PERCENTONEDECIMAL
  602. '       PE_GNF_PERCENTTWODECIMAL
  603. '
  604. '       PE_GVA_STANDARDVIEW
  605. '       PE_GVA_TALLVIEW
  606. '       PE_GVA_TOPVIEW
  607. '       PE_GVA_DISTORTEDVIEW
  608. '       PE_GVA_SHORTVIEW
  609. '       PE_GVA_GROUPEYEVIEW
  610. '       PE_GVA_GROUPEMPHASISVIEW
  611. '       PE_GVA_FEWSERIESVIEW
  612. '       PE_GVA_FEWGROUPSVIEW
  613. '       PE_GVA_DISTORTEDSTDVIEW
  614. '       PE_GVA_THICKGROUPSVIEW
  615. '       PE_GVA_SHORTERVIEW
  616. '       PE_GVA_THICKSERIESVIEW
  617. '       PE_GVA_THICKSTDVIEW
  618. '       PE_GVA_BIRDSEYEVIEW
  619. '       PE_GVA_MAXVIEW
  620. '
  621. '       PE_OR_NO_SORT
  622. '       PE_OR_ALPHANUMERIC_ASCENDING
  623. '       PE_OR_ALPHANUMERIC_DESCENDING
  624. '       PE_OR_NUMERIC_ASCENDING
  625. '       PE_OR_NUMERIC_DESCENDING
  626. '
  627. '       PE_DR_HASRANGE
  628. '       PE_DR_HASDISCRETE
  629. '       PE_DR_HASDISCRETEANDRANGE
  630. '
  631. '       PE_CONNECTION_BUFFER_LEN
  632. '
  633. '       PE_TCD_OKAY
  634. '       PE_TCD_DATABASENOTFOUND
  635. '       PE_TCD_SERVERNOTFOUND
  636. '       PE_TCD_SERVERNOTOPENED
  637. '       PE_TCD_ALIASCHANGED
  638. '       PE_TCD_INDEXESCHANGED
  639. '       PE_TCD_DRIVERCHANGED
  640. '       PE_TCD_DICTIONARYCHANGED
  641. '       PE_TCD_FILETYPECHANGED
  642. '       PE_TCD_RECORDSIZECHANGED
  643. '       PE_TCD_ACCESSCHANGED
  644. '       PE_TCD_PARAMETERSCHANGED
  645. '       PE_TCD_LOCATIONCHANGED
  646. '       PE_TCD_DATABASEOTHER
  647. '       PE_TCD_NUMFIELDSCHANGED
  648. '       PE_TCD_FIELDOTHER
  649. '       PE_TCD_FIELDNAMECHANGED
  650. '       PE_TCD_FIELDDESCCHANGED
  651. '       PE_TCD_FIELDTYPECHANGED
  652. '       PE_TCD_FIELDSIZECHANGED
  653. '       PE_TCD_NATIVEFIELDTYPECHANGED
  654. '       PE_TCD_NATIVEFIELDOFFSETCHANGED
  655. '       PE_TCD_NATIVEFIELDSIZECHANGED
  656. '       PE_TCD_FIELDDECPLACESCHANGED
  657. '
  658. '       PE_SIZEOF_GRAPH_TYPE_INFO
  659. '       PE_SIZEOF_FONT_COLOR_INFO
  660. '       PE_SIZEOF_GRAPH_OPTION_INFO
  661. '       PE_SIZEOF_GRAPH_AXIS_INFO
  662. '       PE_SIZEOF_PICK_LIST_OPTION
  663. '       PE_SIZEOF_TABLE_DIFFERENCE_INFO
  664. '
  665. ' Modified Const values:
  666. '       PE_SIZEOF_REPORT_OPTIONS
  667. '       PE_SIZEOF_TABLE_LOCATION
  668. '       PE_SIZEOF_WINDOW_OPTIONS
  669. '
  670. ' Modified Types:
  671. '       PEReportOptions
  672. '               Added member:
  673. '               doAsyncQuery
  674. '       PETableLocation
  675. '               Added members:
  676. '               SubLocation
  677. '               ConnectBuffer
  678. '       PEWindowOptions
  679. '               Added members:
  680. '               showToolbarTips
  681. '               showDocumentTips
  682. '
  683. ' Added Type(s):
  684. '       PEGraphTypeInfo
  685. '       PEFontColorInfo
  686. '       PEGraphOptionInfo
  687. '       PEGraphAxisInfo
  688. '       PEParameterPickListOption
  689. '       PETableDifferenceInfo
  690. '
  691. ' Added Declarations:
  692. '       PEGetGraphTypeInfo()
  693. '       PESetGraphTypeInfo()
  694. '       PEGetGraphTextInfo()
  695. '       PESetGraphTextInfo()
  696. '       PEGetGraphFontInfo()
  697. '       PESetGraphFontInfo()
  698. '       PEGetGraphOptionInfo()
  699. '       PESetGraphOptionInfo()
  700. '
  701. '       PEGetNthParameterValueDescription()
  702. '       PESetNthParameterValueDescription()
  703. '       PEGetParameterPickListOption()
  704. '       PESetParameterPickListOption()
  705. '
  706. '       PECheckNthTableDifferences()
  707. '
  708. ' Moved Declarations to obs32.bas:
  709. '       PEGetGraphType()
  710. '       PEGetGraphData()
  711. '       PEGetGraphText()
  712. '       PEGetGraphOptions()
  713. '       PESetGraphType()
  714. '       PESetGraphData()
  715. '       PESetGraphText()
  716. '       PESetGraphOptions()
  717. ' Moved Consts to obs32.bas:
  718. '       PE_SIDE_BY_SIDE_BAR_GRAPH
  719. '       PE_STACKED_BAR_GRAPH
  720. '       PE_PERCENT_BAR_GRAPH
  721. '       PE_FAKED_3D_SIDE_BY_SIDE_BAR_GRAPH
  722. '       PE_FAKED_3D_STACKED_BAR_GRAPH
  723. '       PE_FAKED_3D_PERCENT_BAR_GRAPH
  724. '       PE_PIE_GRAPH
  725. '       PE_MULTIPLE_PIE_GRAPH
  726. '       PE_PROPORTIONAL_MULTI_PIE_GRAPH
  727. '       PE_LINE_GRAPH
  728. '       PE_AREA_GRAPH
  729. '       PE_THREED_BAR_GRAPH
  730. '       PE_USER_DEFINED_GRAPH
  731. '       PE_UNKNOWN_TYPE_GRAPH
  732. '
  733. '       PE_GRAPH_ROWS_ONLY
  734. '       PE_GRAPH_COLS_ONLY
  735. '       PE_GRAPH_MIXED_ROW_COL
  736. '       PE_GRAPH_MIXED_COL_ROW
  737. '       PE_GRAPH_UNKNOWN_DIRECTION
  738. '
  739. '       PE_GRAPH_DATA_NULL_SELECTION
  740. '       PE_GRAPH_TEXT_LEN
  741. '
  742. '       PE_SIZEOF_GRAPH_DATA_INFO
  743. '       PE_SIZEOF_GRAPH_TEXT_INFO
  744. '       PE_SIZEOF_GRAPH_OPTIONS
  745. '
  746. '       PE_SIZEOF_PRINT_FILE_OPTIONS
  747. '       PE_SIZEOF_CHAR_SEP_FILE_OPTIONS
  748. '
  749. ' Moved types to obs32.bas
  750. '       PEGraphDataInfo
  751. '       PEGraphTextInfo
  752. '       PEGraphOptions
  753. '
  754. '       PEPrintFileOptions
  755. '       PECharSepFileOptions
  756. '
  757. ' BCK - Added consts (For 7.0 MR1)
  758. '//axis division method
  759. '       PE_ADM_AUTOMATIC                0
  760. '       PE_ADM_MANUAL                   1
  761. '
  762. '       PE_ERR_INVALIDPARAMETERRANGEINFO    672 // Invalid PE_RI_* combination.
  763. '
  764. '       PE_GRAPH_TEXT_LEN
  765. '
  766. ' SM - Updated for 8.0 Nov 11, 1999
  767. '
  768. ' Added error constants:
  769. ' PE_ERR_NOTEXTERNALSUBREPORT
  770. ' PE_ERR_INVALIDPARAMETERVALUE
  771. ' PE_ERR_INVALIDFORMULASYNTAXTYPE
  772. ' PE_ERR_INVALIDCROPVALUE
  773. ' PE_ERR_INVALIDCOLLATIONVALUE
  774. ' PE_ERR_STARTPAGEGREATERSTOPPAGE
  775. '
  776. ' Added PEReportOptions constants for promptMode member
  777. ' PE_RPTOPT_PROMPT_NONE
  778. ' PE_RPTOPT_PROMPT_NORMAL
  779. ' PE_RPTOPT_PROMPT_ALWAYS
  780.  
  781. ' Modified type PEReportOptions
  782. ' - Added members:
  783. '       promptMode
  784. '       selectDistinctRecords
  785. '
  786. ' Updated struct size const PE_SIZEOF_REPORT_OPTIONS
  787. '
  788. ' Modified type PEGroupOptions
  789. ' - Added members
  790. '       hierarchicalSorting
  791. '       instanceIDField [PE_FIELD_NAME_LEN]
  792. '       parentIDField [PE_FIELD_NAME_LEN]
  793. '       groupIndent
  794. '
  795. ' Updated struct size const PE_SIZEOF_GROUP_OPTIONS
  796. '
  797. ' Added function
  798. ' - PEGetNSectionsInArea()
  799. '
  800. ' Modified type PESectionOptions
  801. ' - Added member
  802. '       reserveMinimumPageFooter
  803. '
  804. ' Updated struct size const PE_SIZEOF_SECTION_OPTIONS
  805. '
  806. ' Added constants:
  807. ' PE_SRI_UNDEFINED
  808. ' PE_SRI_ONOPENJOB
  809. ' PE_SRI_ONFUNCTIONCALL
  810. '
  811. ' Modified type PESubreportInfo
  812. ' Added members:
  813. '       external
  814. '       reimportOption
  815. '
  816. ' Updated struct size const PE_SIZEOF_SUBREPORT_INFO
  817. '
  818. ' Modified type PEFontColorInfo
  819. ' Added member:
  820. '       twipSize
  821. '
  822. ' Updated struct size const PE_SIZEOF_FONT_COLOR_INFO
  823. '
  824. ' Added functions:
  825. '       PESetGraphTextDefaultOption
  826. '       PEGetGraphTextDefaultOption
  827. '
  828. ' Added constants:
  829. ' PE_GLL_PERCENTAGE
  830. ' PE_GLL_AMOUNT
  831. ' PE_GLL_CUSTOM
  832. '
  833. ' Modified type PEGraphOptionInfo
  834. ' Added member:
  835. '       legendLayout
  836. '
  837. ' Updated struct size const PE_SIZEOF_GRAPH_OPTION_INFO
  838. '
  839. ' Modified type PEGraphAxisInfo
  840. ' Added members:
  841. '       dataAxisYAutoScale
  842. '       dataAxisY2AutoScale
  843. '       seriesAxisAutoScale
  844. '
  845. ' Updated struct size const PE_SIZEOF_GRAPH_AXIS_INFO
  846. '
  847. ' Modified type PEWindowOptions
  848. ' Added member:
  849. '       hasLaunchButton
  850. '
  851. ' Updated struct size const PE_SIZEOF_WINDOW_OPTIONS
  852. '
  853. ' Added function:
  854. '       PEFreeDevMode
  855. '
  856. ' Modified type PEReportSummaryInfo
  857. ' Added member:
  858. '       savePreviewPicture
  859. '
  860. ' Updated struct size const PE_SIZEOF_REPORT_SUMMARY_INFO
  861. '
  862. ' Added consts:
  863. ' PE_FS_SIZE
  864. ' PE_FST_CRYSTAL
  865. ' PE_FST_BASIC
  866. '
  867. ' Added type PEFormulaSyntax
  868. ' Added struct size const PE_SIZEOF_FORMULA_SYNTAX
  869. ' Added functions:
  870. '       PESetFormulaSyntax
  871. '       PEGetFormulaSyntax
  872. '
  873. ' BCK - Updated
  874. ' Added PEGetReportVersion
  875. ' and Report Alerting feature calls
  876. '
  877. 'Mar 06, 2002
  878. '       Added new PEGroupOptions
  879. '               customizeGroupname
  880. '               notInTopOrBottomNName
  881. '       Added new constants for VI_VALUE
  882. '               PE_VI_STRINGHANDLE
  883. '               PE_VI_HANDLE
  884. '       Added new export options
  885. '               unicodeFormatOptions
  886. '               unicodeDestinationOptions
  887. 'RM - June 18 2002
  888. '       Changed all references to crpe32 dll to include full path
  889.  
  890. Global Const PE_UNCHANGED_COLOR = -2
  891.  
  892. Global Const PE_ERR_NOERROR = 0
  893.  
  894. Global Const PE_ERR_NOTENOUGHMEMORY = 500
  895. Global Const PE_ERR_INVALIDJOBNO = 501
  896. Global Const PE_ERR_INVALIDHANDLE = 502
  897. Global Const PE_ERR_STRINGTOOLONG = 503
  898. Global Const PE_ERR_NOSUCHREPORT = 504
  899. Global Const PE_ERR_NODESTINATION = 505
  900. Global Const PE_ERR_BADFILENUMBER = 506
  901. Global Const PE_ERR_BADFILENAME = 507
  902. Global Const PE_ERR_BADFIELDNUMBER = 508
  903. Global Const PE_ERR_BADFIELDNAME = 509
  904. Global Const PE_ERR_BADFORMULANAME = 510
  905. Global Const PE_ERR_BADSORTDIRECTION = 511
  906. Global Const PE_ERR_ENGINENOTOPEN = 512
  907. Global Const PE_ERR_INVALIDPRINTER = 513
  908. Global Const PE_ERR_PRINTFILEEXISTS = 514
  909. Global Const PE_ERR_BADFORMULATEXT = 515
  910. Global Const PE_ERR_BADGROUPSECTION = 516
  911. Global Const PE_ERR_ENGINEBUSY = 517
  912. Global Const PE_ERR_BADSECTION = 518
  913. Global Const PE_ERR_NOPRINTWINDOW = 519
  914. Global Const PE_ERR_JOBALREADYSTARTED = 520
  915. Global Const PE_ERR_BADSUMMARYFIELD = 521
  916. Global Const PE_ERR_NOTENOUGHSYSRES = 522
  917. Global Const PE_ERR_BADGROUPCONDITION = 523
  918. Global Const PE_ERR_JOBBUSY = 524
  919. Global Const PE_ERR_BADREPORTFILE = 525
  920. Global Const PE_ERR_NODEFAULTPRINTER = 526
  921. Global Const PE_ERR_SQLSERVERERROR = 527
  922. Global Const PE_ERR_BADLINENUMBER = 528
  923. Global Const PE_ERR_DISKFULL = 529
  924. Global Const PE_ERR_FILEERROR = 530
  925. Global Const PE_ERR_INCORRECTPASSWORD = 531
  926. Global Const PE_ERR_BADDATABASEDLL = 532
  927. Global Const PE_ERR_BADDATABASEFILE = 533
  928. Global Const PE_ERR_ERRORINDATABASEDLL = 534
  929. Global Const PE_ERR_DATABASESESSION = 535
  930. Global Const PE_ERR_DATABASELOGON = 536
  931. Global Const PE_ERR_DATABASELOCATION = 537
  932. Global Const PE_ERR_BADSTRUCTSIZE = 538
  933. Global Const PE_ERR_BADDATE = 539
  934. Global Const PE_ERR_BADEXPORTDLL = 540
  935. Global Const PE_ERR_ERRORINEXPORTDLL = 541
  936. Global Const PE_ERR_PREVATFIRSTPAGE = 542
  937. Global Const PE_ERR_NEXTATLASTPAGE = 543
  938. Global Const PE_ERR_CANNOTACCESSREPORT = 544
  939. Global Const PE_ERR_USERCANCELLED = 545
  940. Global Const PE_ERR_OLE2NOTLOADED = 546
  941. Global Const PE_ERR_BADCROSSTABGROUP = 547
  942. Global Const PE_ERR_NOCTSUMMARIZEDFIELD = 548
  943. Global Const PE_ERR_DESTINATIONNOTEXPORT = 549
  944. Global Const PE_ERR_INVALIDPAGENUMBER = 550
  945. Global Const PE_ERR_NOTSTOREDPROCEDURE = 552
  946. Global Const PE_ERR_INVALIDPARAMETER = 553
  947. Global Const PE_ERR_GRAPHNOTFOUND = 554
  948. Global Const PE_ERR_INVALIDGRAPHTYPE = 555
  949. Global Const PE_ERR_INVALIDGRAPHDATA = 556
  950. Global Const PE_ERR_CANNOTMOVEGRAPH = 557
  951. Global Const PE_ERR_INVALIDGRAPHTEXT = 558
  952. Global Const PE_ERR_INVALIDGRAPHOPT = 559
  953.  
  954. 'New Error Codes For 5.0
  955. Global Const PE_ERR_BADSECTIONHEIGHT = 560
  956. Global Const PE_ERR_BADVALUETYPE = 561
  957. Global Const PE_ERR_INVALIDSUBREPORTNAME = 562
  958. Global Const PE_ERR_NOPARENTWINDOW = 564     'dialog parent window
  959. Global Const PE_ERR_INVALIDZOOMFACTOR = 565  'zoom factor
  960. Global Const PE_ERR_PAGESIZEOVERFLOW = 567
  961. Global Const PE_ERR_LOWSYSTEMRESOURCES = 568
  962. Global Const PE_ERR_BADGROUPNUMBER = 570
  963. Global Const PE_ERR_INVALIDNEGATIVEVALUE = 572
  964. Global Const PE_ERR_INVALIDMEMORYPOINTER = 573
  965. Global Const PE_ERR_INVALIDPARAMETERNUMBER = 594
  966. Global Const PE_ERR_SQLSERVERNOTOPENED = 599
  967.  
  968. Global Const PE_ERR_NOTIMPLEMENTED = 999
  969.  
  970. 'new constants for 7.0
  971. Global Const PE_ERR_INVALIDOBJECTFORMATNAME = 571
  972. Global Const PE_ERR_INVALIDOBJECTTYPE = 574
  973. Global Const PE_ERR_INVALIDGRAPHDATATYPE = 577
  974. Global Const PE_ERR_INVALIDSUBREPORTLINKNUMBER = 582
  975. Global Const PE_ERR_SUBREPORTLINKEXIST = 583
  976. Global Const PE_ERR_BADROWCOLVALUE = 584
  977. Global Const PE_ERR_INVALIDSUMMARYNUMBER = 585
  978. Global Const PE_ERR_INVALIDGRAPHDATAFIELDNUMBER = 586
  979. Global Const PE_ERR_INVALIDSUBREPORTNUMBER = 587
  980. Global Const PE_ERR_INVALIDFIELDSCOPE = 588
  981. Global Const PE_ERR_FIELDINUSE = 590
  982. Global Const PE_ERR_INVALIDPAGEMARGINS = 595
  983. Global Const PE_ERR_REPORTONSECUREQUERY = 596
  984. Global Const PE_ERR_CANNOTOPENSECUREQUERY = 597
  985. Global Const PE_ERR_INVALIDSECTIONNUMBER = 598
  986. Global Const PE_ERR_TABLENAMEEXIST = 606
  987. Global Const PE_ERR_INVALIDCURSOR = 607
  988. Global Const PE_ERR_FIRSTPASSNOTFINISHED = 608
  989. Global Const PE_ERR_CREATEDATASOURCE = 609
  990. Global Const PE_ERR_CREATEDRILLDOWNPARAMETERS = 610
  991. Global Const PE_ERR_CHECKFORDATASOURCECHANGES = 613
  992. Global Const PE_ERR_STARTBACKGROUNDPROCESSING = 614
  993. Global Const PE_ERR_SQLSERVERINUSE = 619
  994. Global Const PE_ERR_GROUPSORTFIELDNOTSET = 620
  995. Global Const PE_ERR_CANNOTSETSAVESUMMARIES = 621
  996. Global Const PE_ERR_LOADOLAPDATABASEMANAGER = 622
  997. Global Const PE_ERR_OPENOLAPCUBE = 623
  998. Global Const PE_ERR_READOLAPCUBEDATA = 624
  999. Global Const PE_ERR_CANNOTSAVEQUERY = 626
  1000. Global Const PE_ERR_CANNOTREADQUERYDATA = 627
  1001. Global Const PE_ERR_MAINREPORTFIELDLINKED = 629
  1002. Global Const PE_ERR_INVALIDMAPPINGTYPEVALUE = 630
  1003. Global Const PE_ERR_HITTESTFAILED = 636
  1004. Global Const PE_ERR_BADSQLEXPRESSIONNAME = 637        ' no SQL expression by the specified *name* exists in this report.
  1005. Global Const PE_ERR_BADSQLEXPRESSIONNUMBER = 638      ' no SQL expression by the specified *number* exists in this report.
  1006. Global Const PE_ERR_BADSQLEXPRESSIONTEXT = 639        ' not a valid SQL expression
  1007. Global Const PE_ERR_INVALIDDEFAULTVALUEINDEX = 641    ' invalid index for default value of a parameter.
  1008. Global Const PE_ERR_NOMINMAXVALUE = 642               ' the specified PE_PF_* type does not have min/max values.
  1009. Global Const PE_ERR_INCONSISTANTTYPES = 643           ' if both min and max values are specified in PESetParameterMinMaxValue,
  1010.                                                       ' the value types for the min and max must be the same.
  1011. Global Const PE_ERR_CANNOTLINKTABLES = 645
  1012. Global Const PE_ERR_CREATEROUTER = 646
  1013. Global Const PE_ERR_INVALIDFIELDINDEX = 647
  1014. Global Const PE_ERR_INVALIDGRAPHTITLETYPE = 648
  1015. Global Const PE_ERR_INVALIDGRAPHTITLEFONTTYPE = 649
  1016.  
  1017. 'end new for 7.0 section
  1018.  
  1019. ' new consts for 7.0, MR1
  1020. Global Const PE_ERR_PARAMTYPEDIFFERENT = 650 ' the type used in a add/set value API for a
  1021.                                              ' parameter differs with it's existing type.
  1022. Global Const PE_ERR_INCONSISTANTRANGETYPES = 651 ' the value type for both start & end range
  1023.                                                  ' values must be the same.
  1024. Global Const PE_ERR_RANGEORDISCRETE = 652       ' an operation was attempted on a discrete parameter that is
  1025.                                                 ' only legal for range parameters or vice versa.
  1026.  
  1027. Global Const PE_ERR_NOTMAINREPORT = 654         ' an operation was attempted that is disallowed for subreports.
  1028.  
  1029. Global Const PE_ERR_INVALIDCURRENTVALUEINDEX = 655 ' invalid index for current value of a parameter.
  1030. Global Const PE_ERR_LINKEDPARAMVALUE = 656 ' operation illegal on linked parameter.
  1031.  
  1032. Global Const PE_ERR_INVALIDPARAMETERRANGEINFO = 672 ' Invalid PE_RI_* combination.
  1033.  
  1034. Global Const PE_ERR_INVALIDSORTMETHODINDEX = 674 ' Invalid sort method index.
  1035.  
  1036. Global Const PE_ERR_INVALIDGRAPHSUBTYPE = 675   ' Invalid PE_GST_* or
  1037.                                                 ' PE_GST_* does not match PE_GT_* or
  1038.                                                 ' PE_GST_* current graph type.
  1039. Global Const PE_ERR_BADGRAPHOPTIONINFO = 676    ' one of them members of PEGraphOptionInfo is out of range.
  1040. Global Const PE_ERR_BADGRAPHAXISINFO = 677      ' one of them members of PEGraphAxisInfo is out of range.
  1041.  
  1042. Global Const PE_ERR_NOTEXTERNALSUBREPORT = 680  ' the subreport is not imported.
  1043. Global Const PE_ERR_INVALIDPARAMETERVALUE = 687
  1044. Global Const PE_ERR_INVALIDFORMULASYNTAXTYPE = 688 ' specified formula syntax not in PE_FST_*
  1045. Global Const PE_ERR_INVALIDCROPVALUE = 689
  1046. Global Const PE_ERR_INVALIDCOLLATIONVALUE = 690
  1047. Global Const PE_ERR_STARTPAGEGREATERSTOPPAGE = 691
  1048. Global Const PE_ERR_INVALIDEXPORTFORMAT = 692
  1049. ' end new for 7.0 MR1
  1050.  
  1051. ' New for 8.5
  1052. Global Const PE_ERR_READONLYPARAMETEROPTION = 700  'Error Text - "This parameter option is read only and cannot be changed."
  1053. Global Const PE_ERR_MINGREATERTHANMAX = 702        'Error Text - "The minimum cannot be greater than the maximum."
  1054. Global Const PE_ERR_INVALIDSTARTPAGE = 703         'Error Text - "Specified start page is greater than the last page on the report."
  1055. ' end new for 8.5
  1056.  
  1057. Global Const PE_ERR_OTHERERROR = 997
  1058. Global Const PE_ERR_INTERNALERROR = 998               ' programming error
  1059.  
  1060. 'Constants using to calculate structure size constants
  1061. Global Const PE_BYTE_LEN = 1
  1062. Global Const PE_WORD_LEN = 2
  1063. Global Const PE_LONG_LEN = 4
  1064. Global Const PE_DOUBLE_LEN = 8
  1065.  
  1066. ' Open, print and close report (used when no changes needed to report)
  1067. ' --------------------------------------------------------------------
  1068.  
  1069. Declare Function PEPrintReport Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal RptName$, ByVal Printer%, ByVal Window%, ByVal Title$, ByVal Lft&, ByVal Top&, ByVal Wdth&, ByVal height&, ByVal style As Long, ByVal PWindow As Long) As Integer
  1070.  
  1071.  
  1072. ' Open and close print engine
  1073. ' ---------------------------
  1074.  
  1075. Declare Function PEOpenEngine Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" () As Integer
  1076. Declare Sub PECloseEngine Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" ()
  1077. Declare Function PECanCloseEngine Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" () As Integer
  1078.  
  1079.  
  1080. ' Get version info
  1081. ' ----------------
  1082.  
  1083. Global Const PE_GV_DLL = 100      ' values for version parameter of PEGetVersion
  1084. Global Const PE_GV_ENGINE = 200
  1085.  
  1086. Declare Function PEGetVersion Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal version%) As Integer
  1087.  
  1088.  
  1089. ' Open and close print job (i.e. report)
  1090. ' --------------------------------------
  1091.  
  1092. Declare Function PEOpenPrintJob Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal RptName$) As Integer
  1093.  
  1094. Declare Function PEClosePrintJob Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1095.  
  1096.  
  1097. ' Start and cancel print job (i.e. print the report, usually after changing report)
  1098. ' ---------------------------------------------------------------------------------
  1099.  
  1100. Declare Function PEStartPrintJob Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal WaitOrNot%) As Integer
  1101.  
  1102. Declare Sub PECancelPrintJob Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%)
  1103.  
  1104.  
  1105. ' report options
  1106. '----------------
  1107. Global Const PE_RPTOPT_CVTDATETIMETOSTR = 0
  1108. Global Const PE_RPTOPT_CVTDATETIMETODATE = 1
  1109. Global Const PE_RPTOPT_KEEPDATETIMETYPE = 2
  1110.  
  1111. ' Following are the valid values for promptMode
  1112. Global Const PE_RPTOPT_PROMPT_NONE = 0
  1113. Global Const PE_RPTOPT_PROMPT_NORMAL = 1
  1114. Global Const PE_RPTOPT_PROMPT_ALWAYS = 2
  1115.  
  1116. Type PEReportOptions
  1117.     StructSize As Integer                       'initialize to PE_SIZEOF_REPORT_OPTIONS
  1118.     saveDataWithReport As Integer               'BOOL value, except use PE_UNCHANGED for no change
  1119.     saveSummariesWithReport As Integer          'BOOL value, except use PE_UNCHANGED for no change
  1120.     useIndexForSpeed As Integer                 'BOOL value, except use PE_UNCHANGED for no change
  1121.     translateDOSStrings As Integer              'BOOL value, except use PE_UNCHANGED for no change
  1122.     translateDosMemos As Integer                'BOOL value, except use PE_UNCHANGED for no change
  1123.     convertDateTimeType As Integer              'a PE_RPTOPT_ value, except use PE_UNCHANGED for no change
  1124.     convertNullFieldToDefault As Integer        'BOOL value, except use PE_UNCHANGED for no change
  1125.     morePrintEngineErrorMessages As Integer     'BOOL value, except use PE_UNCHANGED for no change
  1126.     caseInsensitiveSQLData As Integer           'BOOL value, except use PE_UNCHANGED for no change
  1127.     verifyOnEveryPrint As Integer               'BOOL value, except use PE_UNCHAGED for no change
  1128.     zoomMode As Integer                         'a PE_ZOOM_ constant, except use PE_UNCHANGED for no change
  1129.     hasGroupTree As Integer                     'BOOL value, except use PE_UNCHANGED for no change
  1130.     dontGenerateDataForHiddenObjects As Integer ' BOOL value, except use PE_UNCHANGED for no change
  1131.     performGroupingOnServer As Integer          ' BOOL value, except use PE_UNCHANGED for no change
  1132.     doAsyncQuery As Integer                     ' BOOL value, except use PE_UNCHANGED for no change
  1133.     promptMode As Integer                       ' PE_RPTOPT_PROMPT_NONE, PE_RPTOPT_PROMPT_NORMAL, PE_RPTOPT_PROMPT_ALWAYS, use PE_UNCHANGED for no change
  1134.     SelectDistinctRecords As Integer            ' BOOL value, except use PE_UNCHANGED for no change
  1135.     alwaysSortLocally As Integer                ' BOOL value, use PE_UNCHANGED for no change
  1136.     isReadOnly As Integer                       ' BOOL value,  a read-only attribute.
  1137.     canSelectDistinctRecords As Integer         ' BOOL value,  a read-only attribute.
  1138. End Type
  1139.  
  1140. Global Const PE_SIZEOF_REPORT_OPTIONS = 21 * PE_WORD_LEN
  1141.  
  1142. Declare Function PEGetReportOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, reportOptions As PEReportOptions) As Integer
  1143.  
  1144. Declare Function PESetReportOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, reportOptions As PEReportOptions) As Integer
  1145.  
  1146.  
  1147. ' Print job status
  1148. ' ----------------
  1149.  
  1150. Declare Function PEIsPrintJobFinished Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1151.  
  1152. ' To work around the problem of 4 - Byte alignment the PEGetJobStatus
  1153. ' call has been re-declared locally. When your application calls PEGetJobStatus
  1154. ' it is calling a function in this file which in turn calls CRPE32.DLL.
  1155. Global Const PE_JOBNOTSTARTED = 1
  1156. Global Const PE_JOBINPROGRESS = 2
  1157. Global Const PE_JOBCOMPLETED = 3
  1158. Global Const PE_JOBFAILED = 4
  1159. Global Const PE_JOBCANCELLED = 5
  1160. Global Const PE_JOBHALTED = 6   ' too many records or too much time
  1161.  
  1162. Type PEJobInfo
  1163.     StructSize As Integer  ' initialize to PE_SIZEOF_JOB_INFO
  1164.  
  1165.     NumRecordsRead As Long
  1166.     NumRecordsSelected As Long
  1167.     NumRecordsPrinted As Long
  1168.  
  1169.     DisplayPageN As Integer
  1170.     LatestPageN As Integer
  1171.     StartPageN As Integer
  1172.  
  1173.     PrintEnded As Long
  1174. End Type
  1175.  
  1176. Type SplitPEJobInfo
  1177.     StructSize As Integer  ' initialize to PE_SIZEOF_JOB_INFO
  1178.  
  1179.     NumRecordsRead1 As Integer
  1180.     NumRecordsRead2 As Integer
  1181.     NumRecordsSelected1 As Integer
  1182.     NumRecordsSelected2 As Integer
  1183.     NumRecordsPrinted1 As Integer
  1184.     NumRecordsPrinted2 As Integer
  1185.  
  1186.     DisplayPageN As Integer
  1187.     LatestPageN As Integer
  1188.     StartPageN As Integer
  1189.  
  1190.     PrintEnded As Long
  1191. End Type
  1192.  
  1193. Global Const PE_SIZEOF_JOB_INFO = 10 * PE_WORD_LEN + 4
  1194.  
  1195. Declare Function RealPEGetJobStatus Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" Alias "PEGetJobStatus" (ByVal printJob%, JobInfo As SplitPEJobInfo) As Integer
  1196.  
  1197. ' Controlling dialogs
  1198. ' -------------------
  1199.  
  1200. Declare Function PESetDialogParentWindow Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parentWindow As Long) As Integer
  1201.  
  1202. Declare Function PEEnableProgressDialog Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal enable%) As Integer
  1203.  
  1204. ' Controlling Paremeter Field Prompting Dialog
  1205. ' --------------------------------------------
  1206.  
  1207. ' Set boolean to indicate whether CRPE is allowed to prompt for parameter values
  1208. ' during printing.
  1209.  
  1210. Declare Function PEGetAllowPromptDialog Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1211. Declare Function PESetAllowPromptDialog Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal showPromptDialog%) As Integer
  1212.  
  1213.  
  1214. ' Print job error codes and messages
  1215. ' ----------------------------------
  1216.  
  1217. Declare Function PEGetErrorCode Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1218.  
  1219. Declare Function PEGetErrorText Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, TextHandle As Long, TextLength%) As Integer
  1220.  
  1221. Declare Function PEGetHandleString Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal TextHandle As Long, ByVal Buffer$, ByVal BufferLength%) As Integer
  1222.  
  1223.  
  1224. ' Setting the print date
  1225. ' ----------------------
  1226.  
  1227. Declare Function PEGetPrintDate Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, Date_Year%, Date_Month%, Date_Day%) As Integer
  1228.  
  1229. Declare Function PESetPrintDate Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal Date_Year%, ByVal Date_Month%, ByVal Date_Day%) As Integer
  1230.  
  1231. ' Encoding and Decoding Section Codes
  1232. ' -----------------------------------
  1233.  
  1234. Global Const PE_ALLSECTIONS = 0
  1235.  
  1236. 'Section types for use with PE_SECTION_CODE, PE_SECTION_TYPE, PE_GROUP_N and PE_SECTION_N functions
  1237. Global Const PE_SECT_PAGE_HEADER = 2
  1238. Global Const PE_SECT_PAGE_FOOTER = 7
  1239. Global Const PE_SECT_REPORT_HEADER = 1
  1240. Global Const PE_SECT_REPORT_FOOTER = 8
  1241. Global Const PE_SECT_GROUP_HEADER = 3
  1242. Global Const PE_SECT_GROUP_FOOTER = 5
  1243. Global Const PE_SECT_DETAIL = 4
  1244.  
  1245. 'The old section constants with comment showing them in terms of the new:
  1246. '(Note that PE_GRANDTOTALSECTION and PE_SUMMARYSECTION both map
  1247. ' to PE_SECT_REPORT_FOOTER.)
  1248.  
  1249. Global Const PE_HEADERSECTION = 2000  'PE_SECTION_CODE (PE_SECT_PAGE_HEADER,   0, 0)
  1250. Global Const PE_FOOTERSECTION = 7000  'PE_SECTION_CODE (PE_SECT_PAGE_FOOTER,   0, 0)
  1251. Global Const PE_TITLESECTION = 1000   'PE_SECTION_CODE (PE_SECT_REPORT_HEADER, 0, 0)
  1252. Global Const PE_SUMMARYSECTION = 8000 'PE_SECTION_CODE (PE_SECT_REPORT_FOOTER, 0, 0)
  1253. Global Const PE_GROUPHEADER = 3000    'PE_SECTION_CODE (PE_SECT_GROUP_HEADER,  0, 0)
  1254. Global Const PE_GROUPFOOTER = 5000    'PE_SECTION_CODE (PE_SECT_GROUP_FOOTER,  0, 0)
  1255. Global Const PE_DETAILSECTION = 4000  'PE_SECTION_CODE (PE_SECT_DETAIL,        0, 0)
  1256. Global Const PE_GRANDTOTALSECTION = PE_SUMMARYSECTION
  1257.  
  1258.  
  1259. ' Controlling group conditions (i.e. group breaks)
  1260. ' ------------------------------------------------
  1261. Global Const PE_SF_MAX_NAME_LENGTH = 50
  1262.  
  1263. Global Const PE_SF_DESCENDING = 0
  1264. Global Const PE_SF_ASCENDING = 1
  1265. Global Const PE_SF_ORIGINAL = 2 'only for group condition
  1266. Global Const PE_SF_SPECIFIED = 3 'only for group condition
  1267.  
  1268. ' use PE_ANYCHANGE for all field types except Date
  1269. Global Const PE_GC_ANYCHANGE = 0
  1270.  
  1271. ' use these constants for Date and DateTime fields
  1272. Global Const PE_GC_DAILY = 0
  1273. Global Const PE_GC_WEEKLY = 1
  1274. Global Const PE_GC_BIWEEKLY = 2
  1275. Global Const PE_GC_SEMIMONTHLY = 3
  1276. Global Const PE_GC_MONTHLY = 4
  1277. Global Const PE_GC_QUARTERLY = 5
  1278. Global Const PE_GC_SEMIANNUALLY = 6
  1279. Global Const PE_GC_ANNUALLY = 7
  1280.  
  1281. ' use these constants for Time  and DateTime fields
  1282. Global Const PE_GC_BYSECOND = 8
  1283. Global Const PE_GC_BYMINUTE = 9
  1284. Global Const PE_GC_BYHOUR = 10
  1285. Global Const PE_GC_BYAMPM = 11
  1286.  
  1287. ' use these constants for Boolean fields
  1288. Global Const PE_GC_TOYES = 1
  1289. Global Const PE_GC_TONO = 2
  1290. Global Const PE_GC_EVERYYES = 3
  1291. Global Const PE_GC_EVERYNO = 4
  1292. Global Const PE_GC_NEXTISYES = 5
  1293. Global Const PE_GC_NEXTISNO = 6
  1294.  
  1295. Declare Function PESetGroupCondition Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal ConditionField$, ByVal condition%, ByVal SortDirection%) As Integer
  1296.  
  1297. Declare Function PEGetNGroups Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1298.  
  1299. ' for PEGetGroupCondition, Condition% encodes both
  1300. ' the condition and the type of the condition field
  1301. Global Const PE_GC_CONDITIONMASK = &HFF
  1302. Global Const PE_GC_TYPEMASK = &HF00
  1303.  
  1304. Global Const PE_GC_TYPEOTHER = &H0
  1305. Global Const PE_GC_TYPEDATE = &H200
  1306. Global Const PE_GC_TYPEBOOLEAN = &H400
  1307. Global Const PE_GC_TYPETIME = &H800
  1308.  
  1309. Declare Function PEGetGroupCondition Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ConditionFieldHandle As Long, ConditionFieldLength%, condition%, SortDirection%) As Integer
  1310.  
  1311. Global Const PE_FIELD_NAME_LEN = 512
  1312.  
  1313. Global Const PE_GO_TBN_ALL_GROUPS_UNSORTED = 0
  1314. Global Const PE_GO_TBN_ALL_GROUPS_SORTED = 1
  1315. Global Const PE_GO_TBN_TOP_N_GROUPS = 2
  1316. Global Const PE_GO_TBN_BOTTOM_N_GROUPS = 3
  1317.  
  1318. Type PEGroupOptions
  1319.     StructSize As Integer
  1320.     'when setting, pass a PE_GC_ constant, or PE_UNCHANGED for no change.
  1321.     'when getting, use PE_GC_TYPEMASK and PE_GC_CONDITIONMASK to decode the condition.
  1322.     condition As Integer
  1323.     fieldName As String * PE_FIELD_NAME_LEN ' formula form, or empty for no change.
  1324.     SortDirection As Integer                ' a PE_SF_ const, or PE_UNCHANGED for no change.
  1325.     repeatGroupHeader As Integer            ' BOOL value, or PE_UNCHANGED for no change.
  1326.     keepGroupTogether As Integer            ' BOOL value, or PE_UNCHANGED for no change.
  1327.     topOrBottomNGroups As Integer           ' a PE_GO_TBN_ constant, or PE_UNCHANGED for no change.
  1328.     topOrBottomNSortFieldName As String * PE_FIELD_NAME_LEN ' formula form, or empty for no change.
  1329.     ntoporbottomgroups As Integer           ' the number of groups to keep, 0 for all, or PE_UNCHANGED for no change.
  1330.     discardOtherGroups As Integer           ' BOOL value, or PE_UNCHANGED for no change.
  1331.     ignored As Integer                     ' for 4 byte alignment ignored.
  1332.     hierarchicalSorting As Integer              ' Boolean or PE_UNCHANGED
  1333.     instanceIDField As String * PE_FIELD_NAME_LEN       ' for hierarchical grouping
  1334.     parentIDField As String * PE_FIELD_NAME_LEN         ' for hierarchical grouping
  1335.     groupIndent As Long                         ' twips
  1336.     customizeGroupname As Integer       'PEBOOL or PE_UNCHANGED
  1337.     notInTopOrBottomNName As String * PE_FIELD_NAME_LEN 'empty for no change.
  1338. End Type
  1339.  
  1340. Global Const PE_SIZEOF_GROUP_OPTIONS = 10 * PE_WORD_LEN + _
  1341.                                        4 * PE_FIELD_NAME_LEN + _
  1342.                                        1 * PE_LONG_LEN
  1343.  
  1344. Declare Function PEGetGroupOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal groupN%, groupOptions As PEGroupOptions) As Integer
  1345.                                 
  1346. Declare Function PESetGroupOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal groupN%, groupOptions As PEGroupOptions) As Integer
  1347.  
  1348. ' Controlling formulas, selection formulas and group selection formulas
  1349. ' ---------------------------------------------------------------------
  1350.  
  1351. Declare Function PEGetNFormulas Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1352.  
  1353. Declare Function PEGetNthFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal FormulaN%, nameHandle As Long, nameLength%, TextHandle As Long, TextLength%) As Integer
  1354.  
  1355. Declare Function PEGetFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal formulaName$, TextHandle As Long, TextLength%) As Integer
  1356.  
  1357. Declare Function PESetFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal formulaName$, ByVal formulaString$) As Integer
  1358.  
  1359. Declare Function PECheckFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal formulaName$) As Integer
  1360.  
  1361. Declare Function PEGetSelectionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, TextHandle As Long, TextLength%) As Integer
  1362.  
  1363. Declare Function PESetSelectionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal formulaString$) As Integer
  1364.  
  1365. Declare Function PECheckSelectionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1366.  
  1367. Declare Function PEGetGroupSelectionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, TextHandle As Long, TextLength%) As Integer
  1368.  
  1369. Declare Function PESetGroupSelectionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal formulaString$) As Integer
  1370.  
  1371. Declare Function PECheckGroupSelectionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1372.  
  1373.  
  1374. ' SQL Expressions
  1375. '-----------------
  1376.  
  1377. Declare Function PEGetNSQLExpressions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1378.  
  1379. Declare Function PEGetNthSQLExpression Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal expressionN%, nameHandle&, nameLength%, TextHandle&, TextLength%) As Integer
  1380.  
  1381. Declare Function PEGetSQLExpression Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal expressionName$, TextHandle&, TextLength%) As Integer
  1382.  
  1383. Declare Function PESetSQLExpression Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal expressionName$, ByVal expressionString$) As Integer
  1384.  
  1385. Declare Function PECheckSQLExpression Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal expressionName$) As Integer
  1386.  
  1387. '********************************************************************************
  1388. ' NOTE : Stored Procedures
  1389. '
  1390. ' The previous Stored Procedure API Calls PEGetNParams, PEGetNthParam,
  1391. ' PEGetNthParamInfo and PESetNthParam have been made obsolete.  Older
  1392. ' applications that used these API Calls will still work as before, but for new
  1393. ' development please use the new Parameter API calls below,
  1394. '
  1395. ' The Stored Procedure Parameters have now been unified with the Parameter
  1396. ' Fields.
  1397. '
  1398. ' The replacements for these calls are as follows :
  1399. '      PEGetNParams        = PEGetNParameterFields
  1400. '      PEGetNthParam       = PEGetNthParameterField
  1401. '      PEGetNthParamInfo   = PEGetParameterValueInfo
  1402. '      PESetNthParam       = PESetNthParameterField
  1403. '
  1404. ' NOTE : To tell if a Parameter Field is a Stored Procedure, use the
  1405. '        PEGetNthParameterType or PEGetNthParameterField API Calls
  1406. '
  1407. ' If you wish to SET a parameter to NULL then set the CurrentValue to CRWNULL.
  1408. ' The CRWNULL is of Type String and is independant of the datatype of the
  1409. ' parameter.
  1410. '
  1411. '********************************************************************************
  1412.  
  1413. ' Controlling Parameter Fields
  1414. ' ----------------------------
  1415.  
  1416. Global Const PE_PF_REPORT_NAME_LEN = 128
  1417. Global Const PE_PF_NAME_LEN = 256
  1418. Global Const PE_PF_PROMPT_LEN = 256
  1419. Global Const PE_PF_VALUE_LEN = 256
  1420. Global Const PE_PF_EDITMASK_LEN = 256
  1421.  
  1422. Global Const PE_PF_NUMBER = 0
  1423. Global Const PE_PF_CURRENCY = 1
  1424. Global Const PE_PF_BOOLEAN = 2
  1425. Global Const PE_PF_DATE = 3
  1426. Global Const PE_PF_STRING = 4
  1427. Global Const PE_PF_DATETIME = 5
  1428. Global Const PE_PF_TIME = 6
  1429.  
  1430. Type PEParameterFieldInfo
  1431.     'Initialize to PE_SIZEOF_PARAMETER_FIELD_INFO.
  1432.     StructSize As Integer
  1433.  
  1434.     'PE_PF_ constant
  1435.     valueType As Integer
  1436.  
  1437.     'Indicate the default value is set in PEParameterFieldInfo.
  1438.     DefaultValueSet As Integer
  1439.  
  1440.     'Indicate the current value is set in PEParameterFieldInfo.
  1441.     CurrentValueSet As Integer
  1442.  
  1443.     'All strings are null-terminated.
  1444.     name As String * PE_PF_NAME_LEN
  1445.     Prompt As String * PE_PF_PROMPT_LEN
  1446.  
  1447.     ' Could be Number, Date, DateTime, Time, Boolean, or String
  1448.     DefaultValue As String * PE_PF_VALUE_LEN
  1449.     currentValue As String * PE_PF_VALUE_LEN
  1450.  
  1451.     'name of report where the field belongs, only used in PEGetNthParameterField
  1452.     reportName As String * PE_PF_REPORT_NAME_LEN
  1453.  
  1454.     'returns false (0) if parameter is linked, not in use, or has current value set
  1455.     needsCurrentValue As Integer
  1456.     
  1457.     'for String values this will be TRUE if the string is limited on length, for
  1458.     'other types it will be TRUE if the parameter is limited by a range
  1459.     isLimited As Integer
  1460.  
  1461.     ' For string fields, these are the minimum/maximum length of the string.
  1462.     ' For numeric fields, they are the minimum/maximum numeric value.
  1463.     ' For other fields, use PEGetParameterMinMaxValue
  1464.     MinSize As Double
  1465.     MaxSize As Double
  1466.  
  1467.     'An edit mask that restricts what may be entered for string parameters.
  1468.     EditMask As String * PE_PF_EDITMASK_LEN
  1469.  
  1470.     'return true if it is essbase sub var
  1471.     isHidden As Integer
  1472.     
  1473. End Type
  1474.     
  1475. Global Const PE_SIZEOF_VARINFO_TYPE = 5 * PE_WORD_LEN + PE_PF_NAME_LEN + PE_PF_PROMPT_LEN + 2 * PE_PF_VALUE_LEN + PE_PF_REPORT_NAME_LEN
  1476. Global Const PE_SIZEOF_PARAMETER_FIELD_INFO = 7 * PE_WORD_LEN + PE_PF_NAME_LEN + PE_PF_PROMPT_LEN + 2 * PE_PF_VALUE_LEN + PE_PF_REPORT_NAME_LEN + PE_PF_EDITMASK_LEN + 2 * PE_DOUBLE_LEN
  1477.  
  1478. Declare Function PEGetNParameterFields Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1479.  
  1480. Declare Function PEGetNthParameterField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal varN%, varInfo As PEParameterFieldInfo) As Integer
  1481.  
  1482. Declare Function PESetNthParameterField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal varN%, varInfo As PEParameterFieldInfo) As Integer
  1483.  
  1484. '*** Converting parameterInfo default value or current value into value info ****
  1485. Global Const PE_VI_STRING_LEN = 256
  1486.  
  1487. ' define value type
  1488. Global Const PE_VI_NUMBER = 0
  1489. Global Const PE_VI_CURRENCY = 1
  1490. Global Const PE_VI_BOOLEAN = 2
  1491. Global Const PE_VI_DATE = 3
  1492. Global Const PE_VI_STRING = 4
  1493. Global Const PE_VI_DATETIME = 5
  1494. Global Const PE_VI_TIME = 6
  1495. Global Const PE_VI_INTEGER = 7
  1496. Global Const PE_VI_COLOR = 8
  1497. Global Const PE_VI_CHAR = 9
  1498. Global Const PE_VI_LONG = 10
  1499. Global Const PE_VI_STRINGHANDLE = 11    'use viLong as handle and then call PEGetHandleString
  1500. Global Const PE_VI_HANDLE = 12  'use viLong as generic handle.
  1501. Global Const PE_VI_NOVALUE = 100
  1502.  
  1503. Type PEValueInfo
  1504.     StructSize As Integer
  1505.     valueType As Integer  'a PE_VI_ constant
  1506.     viNumber As Double
  1507.     viCurrency As Double
  1508.     viBoolean As Long
  1509.     viString As String * PE_VI_STRING_LEN
  1510.     viDate(0 To 2) As Integer ' year, month, day
  1511.     viDateTime(0 To 5) As Integer ' year, month, day, hour, minute, second
  1512.     viTime(0 To 2) As Integer  ' hour, minute, second
  1513.     viColor As Long
  1514.     viInteger As Integer
  1515.     viC As Byte
  1516.     ignored As Byte 'for 4 byte alignment. ignored.
  1517.     viLong As Long
  1518. End Type
  1519.  
  1520. Global Const PE_SIZEOF_VALUE_INFO = 2 * PE_BYTE_LEN + _
  1521.                                    15 * PE_WORD_LEN + _
  1522.                                     3 * PE_LONG_LEN + _
  1523.                                     2 * PE_DOUBLE_LEN + _
  1524.                                     1 * PE_VI_STRING_LEN
  1525.                                      
  1526. Declare Function PEConvertPFInfoToVInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal Value As Any, ByVal valueType%, valueInfo As PEValueInfo) As Integer
  1527. Declare Function PEConvertVInfoToPFInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (valueInfo As PEValueInfo, valueType%, ByVal Value As Any) As Integer
  1528.  
  1529. ' Default values for Parameter fields.
  1530. ' - If return value is -1 then an error has occurred.
  1531. ' ------------------------------------
  1532. Declare Function PEGetNParameterDefaultValues Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$) As Integer
  1533.  
  1534. Declare Function PEGetNthParameterDefaultValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, ByVal Index%, valueInfo As PEValueInfo) As Integer
  1535.  
  1536. Declare Function PESetNthParameterDefaultValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, ByVal Index%, valueInfo As PEValueInfo) As Integer
  1537.  
  1538. Declare Function PEAddParameterDefaultValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, valueInfo As PEValueInfo) As Integer
  1539.  
  1540. Declare Function PEDeleteNthParameterDefaultValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, ByVal Index%) As Integer
  1541.  
  1542. ' Min/Max values for Parameter fields.
  1543. ' ------------------------------------
  1544. Declare Function PEGetParameterMinMaxValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, valueMin As PEValueInfo, valueMax As PEValueInfo) As Integer
  1545.  
  1546. Declare Function PESetParameterMinMaxValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, valueMin As PEValueInfo, valueMax As PEValueInfo) As Integer
  1547.  
  1548. ' Pick list options in Parameter fields.
  1549. Declare Function PEGetNthParameterValueDescription Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal parameterFieldName As String, ByVal reportName As String, ByVal Index As Integer, valueDesc As Long, valueDescLength As Integer) As Integer
  1550. Declare Function PESetNthParameterValueDescription Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal parameterFieldName As String, ByVal reportName As String, ByVal Index As Integer, ByVal valueDesc As String) As Integer
  1551.  
  1552. ' constants for sortMethod in PEParameterPickListOption struct
  1553. Global Const PE_OR_NO_SORT = 0
  1554. Global Const PE_OR_ALPHANUMERIC_ASCENDING = 1
  1555. Global Const PE_OR_ALPHANUMERIC_DESCENDING = 2
  1556. Global Const PE_OR_NUMERIC_ASCENDING = 3
  1557. Global Const PE_OR_NUMERIC_DESCENDING = 4
  1558.  
  1559. Type PEParameterPickListOption
  1560.     StructSize As Integer       ' initialize to PE_SIZEOF_PICK_LIST_OPTION
  1561.     showDescOnly As Integer     ' boolean value or PE_UNCHANGED
  1562.     sortMethod As Integer       ' enum type const, PE_UNCHANGED for no change
  1563.     sortBasedOnDesc As Integer  ' boolean value or PE_UNCHANGED
  1564. End Type
  1565.  
  1566. Global Const PE_SIZEOF_PICK_LIST_OPTION = (4 * PE_WORD_LEN)
  1567.  
  1568. Declare Function PEGetParameterPickListOption Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal parameterFieldName As String, ByVal reportName As String, pickListOption As PEParameterPickListOption) As Integer
  1569. Declare Function PESetParameterPickListOption Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal parameterFieldName As String, ByVal reportName As String, pickListOption As PEParameterPickListOption) As Integer
  1570.  
  1571. ' Parameter current values
  1572. ' ------------------------
  1573.  
  1574. 'parameter field origin
  1575. Global Const PE_PO_REPORT = 0
  1576. Global Const PE_PO_STOREDPROC = 1
  1577. Global Const PE_PO_QUERY = 2
  1578.  
  1579. ' range info
  1580. Global Const PE_RI_INCLUDEUPPERBOUND = 1
  1581. Global Const PE_RI_INCLUDELOWERBOUND = 2
  1582. Global Const PE_RI_NOUPPERBOUND = 4
  1583. Global Const PE_RI_NOLOWERBOUND = 8
  1584.  
  1585. Global Const PE_DR_HASRANGE = 0
  1586. Global Const PE_DR_HASDISCRETE = 1
  1587. Global Const PE_DR_HASDISCRETEANDRANGE = 2
  1588.  
  1589. Type PEParameterValueInfo
  1590.     StructSize As Integer
  1591.     isNullable As Integer               ' Boolean value or PE_UNCHANGED for no change.
  1592.     disallowEditing As Integer          ' Boolean value or PE_UNCHANGED for no change.
  1593.     allowMultipleValues As Integer      ' Boolean value or PE_UNCHANGED for no change.
  1594.     hasDiscreteValues As Integer        ' PE_UNCHANGED for no change.
  1595.                                         ' 0 means has ranges, 1 means has discrete values
  1596.                                         ' 2 means has discrete and ranged values
  1597.     partOfGroup As Integer              ' Boolean value or PE_UNCHANGED for no change.
  1598.     groupNum As Integer                 ' a group number or PE_UNCHANGED for no change.
  1599.     mutuallyExclusiveGroup As Integer   ' Boolean value or PE_UNCHANGED for no change.
  1600. End Type
  1601.  
  1602. Global Const PE_SIZEOF_PARAMETER_VALUE_INFO = 8 * PE_WORD_LEN
  1603.  
  1604. Declare Function PEGetParameterValueInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, valueInfo As PEParameterValueInfo) As Integer
  1605.  
  1606. Declare Function PESetParameterValueInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, valueInfo As PEParameterValueInfo) As Integer
  1607.  
  1608. ' If return value is -1 then an error has occurred.
  1609. Declare Function PEGetNParameterCurrentValues Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$) As Integer
  1610.  
  1611. Declare Function PEGetNthParameterCurrentValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, ByVal Index%, currentValue As PEValueInfo) As Integer
  1612.  
  1613. Declare Function PEAddParameterCurrentValue Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, currentValue As PEValueInfo) As Integer
  1614.  
  1615. ' If return value is -1 then an error has occurred.
  1616. Declare Function PEGetNParameterCurrentRanges Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$) As Integer
  1617.  
  1618. Declare Function PEGetNthParameterCurrentRange Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, ByVal Index%, rangeStart As PEValueInfo, rangeEnd As PEValueInfo, ByVal rangeInfo%) As Integer
  1619.  
  1620. Declare Function PEAddParameterCurrentRange Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$, rangeStart As PEValueInfo, rangeEnd As PEValueInfo, ByVal rangeInfo%) As Integer
  1621.  
  1622. Declare Function PEGetNthParameterType Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal Index%) As Integer 'returns PE_PO_* or -1 if index is invalid.
  1623.  
  1624. Declare Function PEClearParameterCurrentValuesAndRanges Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal parameterFieldName$, ByVal reportName$) As Integer
  1625.  
  1626. ' Subreport Functions
  1627. ' -------------------------------------------
  1628.  
  1629. Global Const PE_SUBREPORT_NAME_LEN = 128
  1630.  
  1631. ' PE_SRI_ONOPENJOB: Reimport the subreport when opening the main report.
  1632. ' PE_SRI_ONFUNCTIONCALL: Reimport the subreport when the api is called.
  1633. Global Const PE_SRI_UNDEFINED = -1
  1634. Global Const PE_SRI_ONOPENJOB = 0
  1635. Global Const PE_SRI_ONFUNCTIONCALL = 1
  1636.  
  1637. Type PESubreportInfo
  1638.     StructSize As Integer            ' Initialize to PE_SIZEOF_SUBREPORT_INFO.
  1639.     
  1640.     'Strings are null-terminated.
  1641.     name As String * PE_SUBREPORT_NAME_LEN
  1642.  
  1643.     'number of links
  1644.     NLinks As Integer
  1645.  
  1646.     ' subreport placement.
  1647.     isOnDemand As Integer       ' TRUE if the subreport is on demand subreport.
  1648.     external As Integer         ' 1: the subreport is imported; 0: otherwise.
  1649.     reimportOption As Integer   ' PE_SRI_ONOPENJOB or PE_SRI_ONFUNCTIONCALL
  1650. End Type
  1651.  
  1652. Global Const PE_SIZEOF_SUBREPORT_INFO = 4 * PE_WORD_LEN + PE_SUBREPORT_NAME_LEN + 1
  1653.  
  1654. Declare Function PEGetSubreportInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal subreportHandle As Long, subreportInfo As PESubreportInfo) As Integer
  1655.  
  1656. Declare Function PEReimportSubreport Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal subreportHandle As Long, linkChanged As Long, reimported As Long) As Integer
  1657.  
  1658. ' End Subreports
  1659.  
  1660.  
  1661. ' Controlling sort order and group sort order
  1662. ' -------------------------------------------
  1663.  
  1664. Global Const PE_SF_MAXNAMELEN = 50  ' maximum length of a sort field name
  1665.  
  1666. Global Const PE_SF_DESC = 0         ' values for the Direction parameter
  1667. Global Const PE_SF_ASC = 1
  1668.  
  1669. Declare Function PEGetNSortFields Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1670.  
  1671. Declare Function PEGetNthSortField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal SortNumber%, nameHandle As Long, nameLength%, Direction%) As Integer
  1672.  
  1673. Declare Function PESetNthSortField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal SortNumber%, ByVal SortFieldName$, ByVal Direction%) As Integer
  1674.  
  1675. Declare Function PEDeleteNthSortField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal SortFieldN%) As Integer
  1676.  
  1677. Declare Function PEGetNGroupSortFields Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1678.  
  1679. Declare Function PEGetNthGroupSortField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal SortFieldN%, nameHandle As Long, nameLength%, Direction%) As Integer
  1680.  
  1681. Declare Function PESetNthGroupSortField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal SortFieldN%, ByVal SortGroupName$, ByVal Direction%) As Integer
  1682.  
  1683. Declare Function PEDeleteNthGroupSortField Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal SortFieldN%) As Integer
  1684.  
  1685.  
  1686. ' Controlling databases
  1687. ' ---------------------
  1688. '
  1689. ' The following functions allow retrieving and updating database info
  1690. ' in an opened report, so that a report can be printed using different
  1691. ' session, server, database, user and/or table location settings.  Any
  1692. ' changes made to the report via these functions are not permanent, and
  1693. ' only last as long as the report is open.
  1694. '
  1695. ' The following database functions (except for PELogOnServer and
  1696. ' PELogOffServer) must be called after PEOpenPrintJob and before
  1697. ' PEStartPrintJob.
  1698.  
  1699. ' The function PEGetNTables is called to fetch the number of tables in
  1700. ' the report.  This includes all PC databases (e.g. Paradox, xBase)
  1701. ' as well as SQL databases (e.g. SQL Server, Oracle, Netware).
  1702.  
  1703. Declare Function PEGetNTables Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1704.  
  1705. ' The function PEGetNthTableType allows the application to determine the
  1706. ' type of each table.  The application can test DBType (equal to
  1707. ' PE_DT_STANDARD or PE_DT_SQL), or test the database DLL name used to
  1708. ' create the report.  DLL names have the following naming convention:
  1709. '     - PDB*.DLL for standard (non-SQL) databases,
  1710. '     - PDS*.DLL for SQL databases.
  1711. '
  1712. ' In the case of ODBC (PDSODBC.DLL) the DescriptiveName includes the
  1713. ' ODBC data source name.
  1714.  
  1715. Global Const PE_DLL_NAME_LEN = 64
  1716. Global Const PE_FULL_NAME_LEN = 256
  1717. Global Const PE_SIZEOF_TABLE_TYPE = 324 ' # bytes in PETableType
  1718.  
  1719. Global Const PE_DT_STANDARD = 1  ' values for DBType
  1720. Global Const PE_DT_SQL = 2
  1721. Global Const PE_DT_SQL_STORED_PROCEDURE = 3
  1722.  
  1723. Type PETableType
  1724.     StructSize As Integer   ' initialize to # bytes in PETableType
  1725.  
  1726.     DLLName As String * PE_DLL_NAME_LEN
  1727.     DescriptiveName  As String * PE_FULL_NAME_LEN
  1728.  
  1729.     DBType As Integer
  1730. End Type
  1731.  
  1732. Declare Function PEGetNthTableType Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, TableType As PETableType) As Integer
  1733.  
  1734. ' The functions PEGetNthTableSessionInfo and PESetNthTableSessionInfo
  1735. ' are only used when connecting to MS Access databases (which require a
  1736. ' session to be opened first)
  1737.  
  1738. Global Const PE_SESS_USERID_LEN = 128
  1739. Global Const PE_SESS_PASSWORD_LEN = 128
  1740. Global Const PE_SIZEOF_SESSION_INFO = 262  ' # bytes in PESessionInfo
  1741.  
  1742. Type PESessionInfo
  1743.     'initialize to # bytes in PESessionInfo
  1744.     StructSize As Integer
  1745.  
  1746.     ' Password is undefined when getting information from report.
  1747.     UserID As String * PE_SESS_USERID_LEN
  1748.     Password As String * PE_SESS_PASSWORD_LEN
  1749.  
  1750.     ' SessionHandle is undefined when getting information from report.
  1751.     ' When setting information, if it is = 0 the UserID and Password
  1752.     ' settings are used, otherwise the SessionHandle is used.
  1753.     SessionHandle As Long
  1754. End Type
  1755.  
  1756. Declare Function PEGetNthTableSessionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, SessionInfo As PESessionInfo) As Integer
  1757.  
  1758. Declare Function PESetNthTableSessionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, SessionInfo As PESessionInfo, ByVal PropagateAcrossTables%) As Integer
  1759.  
  1760. ' Logging on is performed when printing the report, but the correct
  1761. ' log on information must first be set using PESetNthTableLogOnInfo.
  1762. ' Only the password is required, but the server, database, and
  1763. ' user names may optionally be overriden as well.
  1764. '
  1765. ' If the parameter propagateAcrossTables is TRUE, the new log on info
  1766. ' is also applied to any other tables in this report that had the
  1767. ' same original server and database names as this table.  If FALSE
  1768. ' only this table is updated.
  1769. '
  1770. ' Logging off is performed automatically when the print job is closed.
  1771.  
  1772. Global Const PE_SERVERNAME_LEN = 128
  1773. Global Const PE_DATABASENAME_LEN = 128
  1774. Global Const PE_USERID_LEN = 128
  1775. Global Const PE_PASSWORD_LEN = 128
  1776. Global Const PE_SIZEOF_LOGON_INFO = 514  ' # bytes in PELogOnInfo
  1777.  
  1778. Type PELogOnInfo
  1779.     ' initialize to # bytes in PELogOnInfo
  1780.     StructSize As Integer
  1781.  
  1782.     ' For any of the following values an empty string ("") means to use
  1783.     ' the value already set in the report.  To override a value in the
  1784.     ' report use a non-empty string (e.g. "Server A").
  1785.     '
  1786.     ' For Netware SQL, pass the dictionary path name in ServerName and
  1787.     ' data path name in DatabaseName.
  1788.  
  1789.     ServerName As String * PE_SERVERNAME_LEN
  1790.     DatabaseName  As String * PE_DATABASENAME_LEN
  1791.     UserID As String * PE_USERID_LEN
  1792.  
  1793.     ' Password is undefined when getting information from report.
  1794.  
  1795.     Password  As String * PE_PASSWORD_LEN
  1796. End Type
  1797.  
  1798. Declare Function PEGetNthTableLogOnInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, LogOnInfo As PELogOnInfo) As Integer
  1799. Declare Function PESetNthTableLogOnInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, LogOnInfo As PELogOnInfo, ByVal Propagate%) As Integer
  1800.  
  1801. ' A table's location is fetched and set using PEGetNthTableLocation and
  1802. ' PESetNthTableLocation.  This name is database-dependent, and must be
  1803. ' formatted correctly for the expected database.  For example:
  1804. '     - Paradox: "c:\crw\ORDERS.DB"
  1805. '     - SQL Server: "publications.dbo.authors"
  1806.  
  1807. Global Const PE_TABLE_LOCATION_LEN = 256
  1808. Global Const PE_CONNECTION_BUFFER_LEN = 512
  1809.  
  1810. Type PETableLocation
  1811.     ' initialize to # bytes in PETableLocation
  1812.     StructSize As Integer
  1813.     Location  As String * PE_TABLE_LOCATION_LEN
  1814.     SubLocation As String * PE_TABLE_LOCATION_LEN
  1815.     ConnectBuffer As String * PE_CONNECTION_BUFFER_LEN  ' Connection Info for attached tables
  1816. End Type
  1817.  
  1818. Global Const PE_SIZEOF_TABLE_LOCATION = 1026  ' # bytes in PETableLocation
  1819.  
  1820. Declare Function PEGetNthTableLocation Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, Location As PETableLocation) As Integer
  1821. Declare Function PESetNthTableLocation Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%, Location As PETableLocation) As Integer
  1822.  
  1823. ' The function PETestNthTableConnectivity tests whether a database
  1824. ' table's settings are valid and ready to be reported on.  It returns
  1825. ' true if the database session, log on, and location info is all
  1826. ' correct.
  1827. '
  1828. ' This is useful, for example, in prompting the user and testing a
  1829. ' server password before printing begins.
  1830. '
  1831. ' This function may require a significant amount of time to complete,
  1832. ' since it will first open a user session (if required), then log onto
  1833. ' the database server (if required), and then open the appropriate
  1834. ' database table (to test that it exists).  It does not read any data,
  1835. ' and closes the table immediately once successful.  Logging off is
  1836. ' performed when the print job is closed.
  1837. '
  1838. ' If it fails in any of these steps, the error code set indicates
  1839. ' which database info needs to be updated using functions above:
  1840. '    - If it is unable to begin a session, PE_ERR_DATABASESESSION is set,
  1841. '      and the application should update with PESetNthTableSessionInfo.
  1842. '    - If it is unable to log onto a server, PE_ERR_DATABASELOGON is set,
  1843. '      and the application should update with PESetNthTableLogOnInfo.
  1844. '    - If it is unable open the table, PE_ERR_DATABASELOCATION is set,
  1845. '      and the application should update with PESetNthTableLocation.
  1846.  
  1847. Declare Function PETestNthTableConnectivity Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal TableN%) As Integer
  1848.  
  1849. ' PELogOnServer and PELogOffServer can be called at any time to log on
  1850. ' and off of a database server.  These functions are not required if
  1851. ' function PESetNthTableLogOnInfo above was already used to set the
  1852. ' password for a table.
  1853. '
  1854. ' These functions require a database DLL name, which can be retrieved
  1855. ' using PEGetNthTableType above.
  1856. '
  1857. ' This function can also be used for non-SQL tables, such as password-
  1858. ' protected Paradox tables.  Call this function to set the password
  1859. ' for the Paradox DLL before beginning printing.
  1860. '
  1861. ' Note: When printing using PEStartPrintJob the ServerName passed in
  1862. ' PELogOnServer must agree exactly with the server name stored in the
  1863. ' report.  If this is not true use PESetNthTableLogOnInfo to perform
  1864. ' logging on instead.
  1865.  
  1866. Declare Function PELogOnServer Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal DLLName$, LogOnInfo As PELogOnInfo) As Integer
  1867. Declare Function PELogOffServer Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal DLLName$, LogOnInfo As PELogOnInfo) As Integer
  1868. Declare Function PELogOnSQLServerWithPrivateInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal DLLName$, ByVal PrivateInfo As Long) As Integer
  1869.  
  1870.  
  1871. ' Overriding SQL query in report
  1872. ' ------------------------------
  1873. '
  1874. ' PEGetSQLQuery returns the same query as appears in the Show SQL Query
  1875. ' dialog in CRW, in syntax specific to the database driver you are using.
  1876. '
  1877. ' PESetSQLQuery is mostly useful for reports with SQL queries that
  1878. ' were explicitly edited in the Show SQL Query dialog in CRW, i.e. those
  1879. ' reports that needed database-specific selection criteria or joins.
  1880. ' (Otherwise it is usually best to continue using function calls such as
  1881. ' PESetSelectionFormula and let CRW build the SQL query automatically.)
  1882. '
  1883. ' PESetSQLQuery has the same restrictions as editing in the Show SQL
  1884. ' Query dialog; in particular that changes are accepted in the FROM and
  1885. ' WHERE clauses but ignored in the SELECT list of fields.
  1886.  
  1887. Declare Function PEGetSQLQuery Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, TextHandle As Long, TextLength%) As Integer
  1888.  
  1889. Declare Function PESetSQLQuery Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal QueryString$) As Integer
  1890.  
  1891. 'Field mapping types
  1892. Global Const PE_FM_AUTO_FLD_MAP = 0          'Automatic field name mapping
  1893.                                              'unmapped report fields will be removed
  1894. Global Const PE_FM_CRPE_PROMPT_FLD_MAP = 1   'CRPE provided dialog box to map field manually
  1895.  
  1896. Declare Function PESetFieldMappingType Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal mappingtype As Integer) As Integer
  1897.  
  1898. Declare Function PEGetFieldMappingType Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, mappingtype As Integer) As Integer
  1899.  
  1900. Declare Function PEVerifyDatabase Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1901.  
  1902. ' constants returned from PECheckNthTableDifferences, can be any
  1903. ' combination of the following:
  1904. Global Const PE_TCD_OKAY = &H0
  1905. Global Const PE_TCD_DATABASENOTFOUND = &H1
  1906. Global Const PE_TCD_SERVERNOTFOUND = &H2
  1907. Global Const PE_TCD_SERVERNOTOPENED = &H4
  1908. Global Const PE_TCD_ALIASCHANGED = &H8
  1909. Global Const PE_TCD_INDEXESCHANGED = &H10
  1910. Global Const PE_TCD_DRIVERCHANGED = &H20
  1911. Global Const PE_TCD_DICTIONARYCHANGED = &H40
  1912. Global Const PE_TCD_FILETYPECHANGED = &H80
  1913. Global Const PE_TCD_RECORDSIZECHANGED = &H100
  1914. Global Const PE_TCD_ACCESSCHANGED = &H200
  1915. Global Const PE_TCD_PARAMETERSCHANGED = &H400
  1916. Global Const PE_TCD_LOCATIONCHANGED = &H800
  1917. Global Const PE_TCD_DATABASEOTHER = &H1000
  1918. Global Const PE_TCD_NUMFIELDSCHANGED = &H10000
  1919. Global Const PE_TCD_FIELDOTHER = &H20000
  1920. Global Const PE_TCD_FIELDNAMECHANGED = &H40000
  1921. Global Const PE_TCD_FIELDDESCCHANGED = &H80000
  1922. Global Const PE_TCD_FIELDTYPECHANGED = &H100000
  1923. Global Const PE_TCD_FIELDSIZECHANGED = &H200000
  1924. Global Const PE_TCD_NATIVEFIELDTYPECHANGED = &H400000
  1925. Global Const PE_TCD_NATIVEFIELDOFFSETCHANGED = &H800000
  1926. Global Const PE_TCD_NATIVEFIELDSIZECHANGED = &H1000000
  1927. Global Const PE_TCD_FIELDDECPLACESCHANGED = &H2000000
  1928.  
  1929. Type PETableDifferenceInfo
  1930.     StructSize As Integer
  1931.     tableDifferences As Long    ' any combination of PE_TC_*
  1932.     reserved1 As Long           ' reserved - do not use
  1933.     reserved2 As Long           ' reserved - do not use
  1934. End Type
  1935.  
  1936. Global Const PE_SIZEOF_TABLE_DIFFERENCE_INFO = (1 * PE_WORD_LEN) + (3 * PE_LONG_LEN)
  1937.  
  1938. ' Not implemented for reports based on dictionary, returns PE_ERR_NOTIMPLEMENTED
  1939. Declare Function PECheckNthTableDifferences Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal TableN As Integer, tabledifferenceinfo As PETableDifferenceInfo) As Integer
  1940.  
  1941. ' Saved data
  1942. ' ----------
  1943. '
  1944. ' Use PEHasSavedData to find out if a report currently has saved data
  1945. ' associated with it.  This may or may not be TRUE when a print job is
  1946. ' first opened from a report file.  Since data is saved during a print,
  1947. ' this will always be TRUE immediately after a report is printed.
  1948. '
  1949. ' Use PEDiscardSavedData to release the saved data associated with a
  1950. ' report.  The next time the report is printed, it will get current data
  1951. ' from the database.
  1952. '
  1953. ' The default behavior is for a report to use its saved data, rather than
  1954. ' refresh its data from the database when printing a report.
  1955.  
  1956. Declare Function PEHasSavedData Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, HasSavedData As Long) As Integer
  1957.  
  1958. Declare Function PEDiscardSavedData Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  1959.  
  1960.  
  1961. ' Report title
  1962. ' ------------
  1963.  
  1964. Declare Function PEGetReportTitle Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, TitleHandle As Long, titleLength%) As Integer
  1965. Declare Function PESetReportTitle Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal Title$) As Integer
  1966.  
  1967.  
  1968. ' Controlling print to window
  1969. ' ---------------------------
  1970.  
  1971. Declare Function PEOutputToWindow Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal Title$, ByVal Left As Long, ByVal Top As Long, ByVal Width As Long, ByVal height As Long, ByVal style As Long, ByVal PWindow As Long) As Integer
  1972.  
  1973. Type PEWindowOptions
  1974.     StructSize As Integer            'initialize to PE_SIZEOF_WINDOW_OPTIONS
  1975.  
  1976.     hasGroupTree As Integer          '0 or 1, except use PE_UNCHANGED for no change
  1977.     canDrillDown As Integer          '0 or 1, except use PE_UNCHANGED for no change
  1978.     hasNavigationControls As Integer '0 or 1, except use PE_UNCHANGED for no change
  1979.     hasCancelButton As Integer       '0 or 1, except use PE_UNCHANGED for no change
  1980.     hasPrintButton As Integer        '0 or 1, except use PE_UNCHANGED for no change
  1981.     hasExportButton As Integer       '0 or 1, except use PE_UNCHANGED for no change
  1982.     hasZoomControl As Integer        '0 or 1, except use PE_UNCHANGED for no change
  1983.     hasCloseButton As Integer        '0 or 1, except use PE_UNCHANGED for no change
  1984.     hasProgressControls As Integer   '0 or 1, except use PE_UNCHANGED for no change
  1985.     hasSearchButton As Integer       '0 or 1, except use PE_UNCHANGED for no change
  1986.     hasPrintSetupButton As Integer   '0 or 1, except use PE_UNCHANGED for no change
  1987.     hasRefreshButton As Integer      '0 or 1, except use PE_UNCHANGED for no change
  1988.     showToolbarTips As Integer       ' BOOL value, except use PE_UNCHANGED for no change
  1989.                                      ' default is TRUE (*Show* tooltips on toolbar)
  1990.     showDocumentTips As Integer      ' BOOL value, except use PE_UNCHANGED for no change
  1991.                                      ' default is FALSE (*Hide* tooltips on document)
  1992.     hasLaunchButton As Integer       ' Launch Seagate Analysis button on toolbar.
  1993.                                      ' BOOL value, except use PE_UNCHANGED for no change
  1994.                                      ' default is FALSE
  1995. End Type
  1996.  
  1997. Global Const PE_SIZEOF_WINDOW_OPTIONS = (16 * PE_WORD_LEN)
  1998.  
  1999. Declare Function PEGetWindowOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, Options As PEWindowOptions) As Integer
  2000.  
  2001. Declare Function PESetWindowOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, Options As PEWindowOptions) As Integer
  2002.  
  2003. Declare Function PEGetWindowHandle Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Long
  2004.  
  2005. Declare Sub PECloseWindow Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%)
  2006.  
  2007.  
  2008. ' Controlling printed pages
  2009. ' -------------------------
  2010.  
  2011. Declare Function PEShowNextPage Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2012. Declare Function PEShowFirstPage Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2013. Declare Function PEShowPreviousPage Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2014. Declare Function PEShowLastPage Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2015. Declare Function PEGetNPages Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2016. Declare Function PEShowNthPage Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal pageN%) As Integer
  2017.  
  2018. Global Const PE_ZOOM_FULL_SIZE = 0
  2019. Global Const PE_ZOOM_SIZE_FIT_ONE_SIDE = 1
  2020. Global Const PE_ZOOM_SIZE_FIT_BOTH_SIDES = 2
  2021.  
  2022. Declare Function PEZoomPreviewWindow Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal ZoomLevel%) As Integer
  2023. ' ZoomLevel is a percent from 25 to 400 or a PE_ZOOM_ constant
  2024.  
  2025. ' Controlling print window when print control buttons hidden
  2026. ' ----------------------------------------------------------
  2027.  
  2028. Declare Function PEShowPrintControls Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal ShowPrintControls%) As Integer
  2029.  
  2030. Declare Function PEPrintControlsShowing Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ControlsShowing As Long) As Integer
  2031.  
  2032. Declare Function PEPrintWindow Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal WaitNoWait%) As Integer
  2033.  
  2034. Declare Function PEExportPrintWindow Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal ToMail%, ByVal WaitUntilDone%) As Integer
  2035.  
  2036. Declare Function PENextPrintWindowMagnification Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2037.  
  2038.  
  2039. ' Changing printer selection
  2040. ' --------------------------
  2041.  
  2042. Declare Function PESelectPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal PrinterDriver$, ByVal PrinterName$, ByVal PortName$, DevMode As Any) As Integer
  2043.  
  2044. Declare Function PEGetSelectedPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, DriverHandle As Long, DriverLength%, PrinterHandle As Long, PrinterLength%, PortHandle As Long, PortLength%, DevMode As Any) As Integer
  2045.  
  2046. Declare Function PEFreeDevMode Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, mode As Any) As Integer
  2047.  
  2048.  
  2049.  
  2050. ' Controlling print to printer
  2051. ' ----------------------------
  2052.  
  2053. Declare Function PEOutputToPrinter Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal nCopies%) As Integer
  2054.  
  2055. Declare Function PESetNDetailCopies Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal NDetailCopies%) As Integer
  2056.  
  2057. Declare Function PEGetNDetailCopies Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, NDetailCopies%) As Integer
  2058.  
  2059. ' Extension to PESetPrintOptions function: If the 2nd parameter
  2060. ' (pointer to PEPrintOptions) is set to 0 (null) the function prompts
  2061. ' the user for these options.
  2062. '
  2063. ' With this change, you can get the behaviour of the print-to-printer
  2064. ' button in the print window by calling PESetPrintOptions with a
  2065. ' null pointer and then calling PEPrintWindow.
  2066.  
  2067. Global Const PE_MAXPAGEN = 65535
  2068. Global Const PE_FILE_PATH_LEN = 512
  2069.  
  2070. Global Const PE_UNCOLLATED = 0
  2071. Global Const PE_COLLATED = 1
  2072. Global Const PE_DEFAULTCOLLATION = 2
  2073.  
  2074. Type PEPrintOptions
  2075.     StructSize As Integer   ' initialize to # bytes in PEPrintOptions
  2076.  
  2077.     ' page and copy numbers are 1-origin
  2078.     ' use 0 to preserve the existing settings
  2079.     StartPageN As Integer
  2080.     stopPageN As Integer
  2081.  
  2082.     nReportCopies As Integer
  2083.     collation As Integer
  2084.     outputFileName As String * PE_FILE_PATH_LEN
  2085. End Type
  2086.  
  2087. Global Const PE_SIZEOF_PRINT_OPTIONS = 5 * PE_WORD_LEN + PE_FILE_PATH_LEN
  2088.  
  2089. Declare Function PESetPrintOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, Options As PEPrintOptions) As Integer
  2090.  
  2091. Declare Function PEGetPrintOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, Options As PEPrintOptions) As Integer
  2092.  
  2093.  
  2094. ' Controlling print to file and export
  2095. ' ------------------------------------
  2096.  
  2097. Global Const PE_FT_RECORD = 0
  2098. Global Const PE_FT_TABSEPARATED = 1
  2099. Global Const PE_FT_TEXT = 2
  2100. Global Const PE_FT_DIF = 3
  2101. Global Const PE_FT_CSV = 4
  2102. Global Const PE_FT_CHARSEPARATED = 5
  2103. Global Const PE_FT_TABFORMATTED = 6
  2104.  
  2105. Global Const PE_FIELDDELIMLEN = 17
  2106.  
  2107. Declare Function PEOutputToFile Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal OutputFilePath$, ByVal FileType%, Options As Any) As Integer
  2108.  
  2109. Type PEExportOptions
  2110.     StructSize As Integer   'initialize to # bytes in PEExportOptions
  2111.  
  2112.     FormatDLLName As String * PE_DLL_NAME_LEN
  2113.     FormatType1 As Integer
  2114.     FormatType2 As Integer
  2115.     FormatOptions1 As Integer
  2116.     FormatOptions2 As Integer
  2117.  
  2118.     DestinationDLLName As String * PE_DLL_NAME_LEN
  2119.     DestinationType1 As Integer
  2120.     DestinationType2 As Integer
  2121.     DestinationOptions1 As Integer
  2122.     DestinationOptions2 As Integer
  2123.  
  2124.     ' following are set by PEGetExportOptions,
  2125.     ' and ignored by PEExportTo.
  2126.     NFormatOptionsBytes As Integer
  2127.     NDestinationOptionsBytes As Integer
  2128.     
  2129.     'unicodeOptions
  2130.     unicodeFormatOptions As Integer
  2131.     unicodeDestinationOptions As Integer
  2132. End Type
  2133.  
  2134. Global Const PE_SIZEOF_EXPORT_OPTIONS = 11 * PE_WORD_LEN + 2 * PE_DLL_NAME_LEN
  2135.  
  2136. Declare Function PEGetExportOptions Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ExportOptions As PEExportOptions) As Integer
  2137.  
  2138. Declare Function PEExportTo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ExportOptions As PEExportOptions) As Integer
  2139.  
  2140.  
  2141. ' Setting page margins
  2142. ' --------------------
  2143.  
  2144. Global Const PE_SM_DEFAULT = &H8000
  2145.  
  2146. Declare Function PESetMargins Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal LeftMargin%, ByVal RightMargin%, ByVal TopMargin%, ByVal BottomMargin%) As Integer
  2147.  
  2148. Declare Function PEGetMargins Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, LeftMargin%, RightMargin%, TopMargin%, BottomMargin%) As Integer
  2149.  
  2150.  
  2151. 'Report Summary Info
  2152. '-------------------
  2153.  
  2154. Global Const PE_SI_APPLICATION_NAME_LEN = 128
  2155. Global Const PE_SI_TITLE_LEN = 128
  2156. Global Const PE_SI_SUBJECT_LEN = 128
  2157. Global Const PE_SI_AUTHOR_LEN = 128
  2158. Global Const PE_SI_KEYWORDS_LEN = 128
  2159. Global Const PE_SI_COMMENTS_LEN = 512
  2160. Global Const PE_SI_REPORT_TEMPLATE_LEN = 128
  2161.  
  2162. Type PEReportSummaryInfo
  2163.     StructSize As Integer
  2164.     applicationName As String * PE_SI_APPLICATION_NAME_LEN ' read only.
  2165.     Title As String * PE_SI_TITLE_LEN
  2166.     subject As String * PE_SI_SUBJECT_LEN
  2167.     author As String * PE_SI_AUTHOR_LEN
  2168.     keywords As String * PE_SI_KEYWORDS_LEN
  2169.     comments As String * PE_SI_COMMENTS_LEN
  2170.     reportTemplate As String * PE_SI_REPORT_TEMPLATE_LEN
  2171.     savePreviewPicture As Integer   ' BOOL PE_UNCHANGED for no change
  2172. End Type
  2173.  
  2174. Global Const PE_SIZEOF_REPORT_SUMMARY_INFO = 1 * PE_WORD_LEN + _
  2175.                                       PE_SI_APPLICATION_NAME_LEN + _
  2176.                                       PE_SI_TITLE_LEN + _
  2177.                                       PE_SI_SUBJECT_LEN + _
  2178.                                       PE_SI_AUTHOR_LEN + _
  2179.                                       PE_SI_KEYWORDS_LEN + _
  2180.                                       PE_SI_COMMENTS_LEN + _
  2181.                                       PE_SI_REPORT_TEMPLATE_LEN + _
  2182.                                       1 * PE_WORD_LEN
  2183.                                 
  2184. Declare Function PEGetReportSummaryInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, summaryInfo As PEReportSummaryInfo) As Integer
  2185. Declare Function PESetReportSummaryInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, summaryInfo As PEReportSummaryInfo) As Integer
  2186.  
  2187. ' Setting section height and format
  2188. ' ---------------------------------
  2189.  
  2190. Declare Function PEGetNSections Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2191. Declare Function PEGetNSectionsInArea Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal areaCode As Integer) As Integer ' return -1 if failed
  2192.  
  2193. Declare Function PEGetSectionCode Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionN%) As Integer
  2194.  
  2195. ' MinimumHeight is in twips - 1440 twips to the inch
  2196. 'This is the replacement API Call for PEGetMinimumSectionHeight which is obsolete.
  2197. 'The obsolete API will still work for older applications, but use this for all new development
  2198. Declare Function PEGetSectionHeight Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, height%) As Integer
  2199.  
  2200. 'This is the replacement API Call for PESetMinimumSectionHeight which is obsolete.
  2201. 'The obsolete API will still work for older applications, but use this for all new development
  2202. Declare Function PESetSectionHeight Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal height%) As Integer
  2203.  
  2204. Type PESectionOptions
  2205.     StructSize As Integer   ' initialize to PE_SIZEOF_SECTION_OPTIONS
  2206.  
  2207.     ' use 0 to turn off, 1 to turn on and PE_UNCHANGED to preserve each attribute
  2208.     Visible As Integer
  2209.     NewPageBefore As Integer
  2210.     NewPageAfter As Integer
  2211.     KeepTogether As Integer
  2212.     SuppressBlankSection As Integer
  2213.     ResetPageNAfter As Integer
  2214.     PrintAtBottomOfPage As Integer
  2215.     backgroundColor As Long   ' Use PE_UNCHANGED_COLOR to preserve the
  2216.                               ' existing color.
  2217.     underlaySection As Integer
  2218.     showArea As Integer
  2219.     freeFormPlacement As Integer
  2220.     reserveMinimumPageFooter As Integer 'BOOLEAN or PE_UNCHANGED; Sets the size of the Page Footer area                        // to the size of the largest Page Footer section. Used with
  2221.                      ' PEGetAreaFormat/PESetAreaFormat; ignored when used with PEGetSectionFormat/PESetSectionFormat.
  2222. End Type
  2223.  
  2224. Global Const PE_SIZEOF_SECTION_OPTIONS = 12 * PE_WORD_LEN + 1 * 4
  2225.  
  2226. 'Format formula name
  2227. 'Old naming convention
  2228. Global Const SECTION_VISIBILITY = 58
  2229. Global Const NEW_PAGE_BEFORE = 60
  2230. Global Const NEW_PAGE_AFTER = 61
  2231. Global Const KEEP_SECTION_TOGETHER = 62
  2232. Global Const SUPPRESS_BLANK_SECTION = 63
  2233. Global Const RESET_PAGE_N_AFTER = 64
  2234. Global Const PRINT_AT_BOTTOM_OF_PAGE = 65
  2235. Global Const UNDERLAY_SECTION = 66
  2236. Global Const SECTION_BACK_COLOUR = 67
  2237.  
  2238. 'New naming convention
  2239. Global Const PE_FFN_AREASECTION_VISIBILITY = 58
  2240. Global Const PE_FFN_SECTION_VISIBILITY = 58
  2241. Global Const PE_FFN_SHOW_AREA = 59
  2242. Global Const PE_FFN_NEW_PAGE_BEFORE = 60
  2243. Global Const PE_FFN_NEW_PAGE_AFTER = 61
  2244. Global Const PE_FFN_KEEP_SECTION_TOGETHER = 62
  2245. Global Const PE_FFN_KEEP_TOGETHER = 62
  2246. Global Const PE_FFN_SUPPRESS_BLANK_SECTION = 63
  2247. Global Const PE_FFN_RESET_PAGE_N_AFTER = 64
  2248. Global Const PE_FFN_PRINT_AT_BOTTOM_OF_PAGE = 65
  2249. Global Const PE_FFN_UNDERLAY_SECTION = 66
  2250. Global Const PE_FFN_SECTION_BACK_COLOUR = 67
  2251. Global Const PE_FFN_SECTION_BACK_COLOR = 67
  2252.  
  2253. Declare Function PEGetSectionFormatFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal formulaName%, TextHandle As Long, TextLength%) As Integer
  2254.  
  2255. Declare Function PESetSectionFormatFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal formulaName%, ByVal formulaString$) As Integer
  2256.  
  2257. Declare Function PEGetSectionFormat Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, Options As PESectionOptions) As Integer
  2258.  
  2259. Declare Function PESetSectionFormat Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, Options As PESectionOptions) As Integer
  2260.  
  2261. ' Setting area format
  2262. ' -------------------
  2263.                                                                                                                
  2264. Declare Function PEGetAreaFormatFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal areaCode%, ByVal formulaName%, TextHandle As Long, TextLength%) As Integer
  2265.  
  2266. Declare Function PESetAreaFormatFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal areaCode%, ByVal formulaName%, ByVal formulaString$) As Integer
  2267.  
  2268. Declare Function PEGetAreaFormat Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal areaCode%, Options As PESectionOptions) As Integer
  2269.  
  2270. Declare Function PESetAreaFormat Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal areaCode%, Options As PESectionOptions) As Integer
  2271.  
  2272.  
  2273. ' Setting font info
  2274. ' -----------------
  2275.  
  2276. ' values for ScopeCode - may be ORed together
  2277. Global Const PE_FIELDS = 1
  2278. Global Const PE_TEXT = 2
  2279.  
  2280. Global Const PE_UNCHANGED = -1
  2281.  
  2282. ' to preserve the existing setting, use the following
  2283. '   for FontFamily%    use  FF_DONTCARE
  2284. '   for FontPitch%     use  DEFAULT_PITCH
  2285. '   for CharSet%       use  DEFAULT_CHARSET
  2286. '   for PointSize%     use  0
  2287. '   for isItalic%      use  PE_UNCHANGED
  2288. '   for isUnderlined%  use  PE_UNCHANGED
  2289. '   for isStruckOut%   use  PE_UNCHANGED
  2290. '   for Weight%        use  0
  2291. Declare Function PESetFont Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal scopecode%, ByVal faceName$, ByVal fontFamily%, ByVal fontPitch%, ByVal charSet%, ByVal pointSize%, ByVal isItalic%, ByVal isUnderlined%, ByVal isStruckOut%, ByVal weight%) As Integer
  2292.  
  2293. ' Subreports
  2294. ' ----------
  2295. Declare Function PEGetNSubreportsInSection Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%) As Integer
  2296.  
  2297. Declare Function PEGetNthSubreportInSection Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal sectionCode%, ByVal subreportN%) As Long
  2298.  
  2299.  
  2300. '
  2301. ' G R A P H I N G
  2302. '
  2303. ' - graph type
  2304.  
  2305. Global Const PE_GT_BARCHART = 0
  2306. Global Const PE_GT_LINECHART = 1
  2307. Global Const PE_GT_AREACHART = 2
  2308. Global Const PE_GT_PIECHART = 3
  2309. Global Const PE_GT_DOUGHNUTCHART = 4
  2310. Global Const PE_GT_THREEDRISERCHART = 5
  2311. Global Const PE_GT_THREEDSURFACECHART = 6
  2312. Global Const PE_GT_SCATTERCHART = 7
  2313. Global Const PE_GT_RADARCHART = 8
  2314. Global Const PE_GT_BUBBLECHART = 9
  2315. Global Const PE_GT_STOCKCHART = 10
  2316. Global Const PE_GT_USERDEFINEDCHART = 50        ' for PEGetGraphTypeInfo only -
  2317. Global Const PE_GT_UNKNOWNTYPECHART = 100       ' do not use in PESetGraphTypeInfo.
  2318.  
  2319. ' graph subtype
  2320. ' - bar charts
  2321. Global Const PE_GST_SIDEBYSIDEBARCHART = 0
  2322. Global Const PE_GST_STACKEDBARCHART = 1
  2323. Global Const PE_GST_PERCENTBARCHART = 2
  2324. Global Const PE_GST_FAKED3DSIDEBYSIDEBARCHART = 3
  2325. Global Const PE_GST_FAKED3DSTACKEDBARCHART = 4
  2326. Global Const PE_GST_FAKED3DPERCENTBARCHART = 5
  2327.                                                     
  2328. ' - line charts
  2329. Global Const PE_GST_REGULARLINECHART = 10
  2330. Global Const PE_GST_STACKEDLINECHART = 11
  2331. Global Const PE_GST_PERCENTAGELINECHART = 12
  2332. Global Const PE_GST_LINECHARTWITHMARKERS = 13
  2333. Global Const PE_GST_STACKEDLINECHARTWITHMARKERS = 14
  2334. Global Const PE_GST_PERCENTAGELINECHARTWITHMARKERS = 15
  2335.                                                     
  2336. ' - charts
  2337. Global Const PE_GST_ABSOLUTEAREACHART = 20
  2338. Global Const PE_GST_STACKEDAREACHART = 21
  2339. Global Const PE_GST_PERCENTAREACHART = 22
  2340. Global Const PE_GST_FAKED3DABSOLUTEAREACHART = 23
  2341. Global Const PE_GST_FAKED3DSTACKEDAREACHART = 24
  2342. Global Const PE_GST_FAKED3DPERCENTAREACHART = 25
  2343.                                                     
  2344. ' - pie charts
  2345. Global Const PE_GST_REGULARPIECHART = 30
  2346. Global Const PE_GST_FAKED3DREGULARPIECHART = 31
  2347. Global Const PE_GST_MULTIPLEPIECHART = 32
  2348. Global Const PE_GST_MULTIPLEPROPORTIONALPIECHART = 33
  2349.                                                     
  2350. ' - mmm, doughnut charts
  2351. Global Const PE_GST_REGULARDOUGHNUTCHART = 40
  2352. Global Const PE_GST_MULTIPLEDOUGHNUTCHART = 41
  2353. Global Const PE_GST_MULTIPLEPROPORTIONALDOUGHNUTCHART = 42
  2354.  
  2355. ' 3D riser charts
  2356. Global Const PE_GST_THREEDREGULARCHART = 50
  2357. Global Const PE_GST_THREEDPYRAMIDCHART = 51
  2358. Global Const PE_GST_THREEDOCTAGONCHART = 52
  2359. Global Const PE_GST_THREEDCUTCORNERSCHART = 53
  2360.                                                         
  2361. ' 3D surface charts
  2362. Global Const PE_GST_THREEDSURFACEREGULARCHART = 60
  2363. Global Const PE_GST_THREEDSURFACEWITHSIDESCHART = 61
  2364. Global Const PE_GST_THREEDSURFACEHONEYCOMBCHART = 62
  2365.                                                     
  2366. ' scatter charts
  2367. Global Const PE_GST_XYSCATTERCHART = 70
  2368. Global Const PE_GST_XYSCATTERDUALAXISCHART = 71
  2369. Global Const PE_GST_XYSCATTERWITHLABELSCHART = 72
  2370. Global Const PE_GST_XYSCATTERDUALAXISWITHLABELSCHART = 73
  2371.                                                     
  2372. ' radar charts
  2373. Global Const PE_GST_REGULARRADARCHART = 80
  2374. Global Const PE_GST_STACKEDRADARCHART = 81
  2375. Global Const PE_GST_RADARDUALAXISCHART = 82
  2376.                                                     
  2377. ' bubble charts
  2378. Global Const PE_GST_REGULARBUBBLECHART = 90
  2379. Global Const PE_GST_DUALAXISBUBBLECHART = 91
  2380.                                                     
  2381. ' stocked charts
  2382. Global Const PE_GST_HIGHLOWCHART = 100
  2383. Global Const PE_GST_HIGHLOWDUALAXISCHART = 101
  2384. Global Const PE_GST_HIGHLOWOPENCHART = 102
  2385. Global Const PE_GST_HIGHLOWOPENDUALAXISCHART = 103
  2386. Global Const PE_GST_HIGHLOWOPENCLOSECHART = 104
  2387. Global Const PE_GST_HIGHLOWOPENCLOSEDUALAXISCHART = 105
  2388.  
  2389. Global Const PE_GST_UNKNOWNSUBTYPECHART = 1000
  2390.  
  2391. Type PEGraphTypeInfo
  2392.     StructSize As Integer
  2393.     GraphType As Integer        ' PE_GT_*, PE_UNCHANGED for no change
  2394.     graphSubtype As Integer     ' PE_GST_*, PE_UNCHANGED for no change
  2395. End Type
  2396.  
  2397. Global Const PE_SIZEOF_GRAPH_TYPE_INFO = (3 * PE_WORD_LEN)
  2398.  
  2399. Declare Function PEGetGraphTypeInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, graphTypeInfo As PEGraphTypeInfo) As Integer
  2400. Declare Function PESetGraphTypeInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, graphTypeInfo As PEGraphTypeInfo) As Integer
  2401.  
  2402. ' graph text
  2403.  
  2404. Global Const PE_GTT_TITLE = 0
  2405. Global Const PE_GTT_SUBTITLE = 1
  2406. Global Const PE_GTT_FOOTNOTE = 2
  2407. Global Const PE_GTT_SERIESTITLE = 3
  2408. Global Const PE_GTT_GROUPSTITLE = 4
  2409. Global Const PE_GTT_XAXISTITLE = 5
  2410. Global Const PE_GTT_YAXISTITLE = 6
  2411. Global Const PE_GTT_ZAXISTITLE = 7
  2412.  
  2413. ' graph text fonts
  2414. Global Const PE_GTF_TITLEFONT = 0
  2415. Global Const PE_GTF_SUBTITLEFONT = 1
  2416. Global Const PE_GTF_FOOTNOTEFONT = 2
  2417. Global Const PE_GTF_GROUPSTITLEFONT = 3
  2418. Global Const PE_GTF_DATATITLEFONT = 4
  2419. Global Const PE_GTF_LEGENDFONT = 5
  2420. Global Const PE_GTF_GROUPLABELSFONT = 6
  2421. Global Const PE_GTF_DATALABELSFONT = 7
  2422.  
  2423. Global Const PE_FACE_NAME_LEN = 64
  2424.  
  2425. ' Graph text max length
  2426. Global Const PE_GRAPH_TEXT_LEN = 128
  2427.  
  2428. Type PEFontColorInfo
  2429.     StructSize As Integer
  2430.     faceName As String * PE_FACE_NAME_LEN       ' empty string for no change
  2431.     fontFamily As Integer       ' FF_DONTCARE for no change
  2432.     fontPitch As Integer        ' DEFAULT_PITCH for no change
  2433.     charSet As Integer          ' DEFAULT_CHARSET for no change
  2434.     pointSize As Integer        ' 0 for no change
  2435.     isItalic As Integer         ' BOOL value, except use PE_UNCHANGED for no change.
  2436.     isUnderlined As Integer     ' BOOL value, except use PE_UNCHANGED for no change.
  2437.     isStruckOut As Integer      ' BOOL value, except use PE_UNCHANGED for no change.
  2438.     weight As Integer           ' 0 for no change
  2439.     color As Long               ' COLORREF - PE_UNCHANGED_COLOR for no change.
  2440.     twipSize As Integer         ' Font size in twips, 0 for no change.
  2441.                                 ' Use one of pointSize or twipSize. If both pointSize and twipSize
  2442.                                 ' are non-zero, twipSize will be used and pointSize will be ignored.
  2443. End Type
  2444.  
  2445. Global Const PE_SIZEOF_FONT_COLOR_INFO = PE_WORD_LEN + PE_FACE_NAME_LEN + (9 * PE_WORD_LEN) + PE_LONG_LEN
  2446.  
  2447. ' titleType - PE_GTT_*
  2448. ' title - HANDLE
  2449. Declare Function PEGetGraphTextInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, ByVal titleType As Integer, Title As Long, titleLength As Integer) As Integer
  2450. Declare Function PESetGraphTextInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, ByVal titleType As Integer, ByVal Title As String) As Integer
  2451.  
  2452. ' enable/disable graph default titles
  2453. '
  2454. ' titleType - PE_GTT_*
  2455. '
  2456. Declare Function PESetGraphTextDefaultOption Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, ByVal titleType As Integer, ByVal useDefault As Long) As Integer
  2457. Declare Function PEGetGraphTextDefaultOption Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, ByVal titleType As Integer, useDefault As Long) As Integer
  2458.  
  2459. ' graph font
  2460. ' titleFontType - PE_GTF_*
  2461. Declare Function PEGetGraphFontInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, ByVal titleFontType As Integer, fontColourInfo As PEFontColorInfo) As Integer
  2462. Declare Function PESetGraphFontInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, ByVal titleFontType As Integer, fontColourInfo As PEFontColorInfo) As Integer
  2463.  
  2464. ' graph options
  2465. Global Const PE_GLP_PLACEUPPERRIGHT = 0
  2466. Global Const PE_GLP_PLACEBOTTOMCENTER = 1
  2467. Global Const PE_GLP_PLACETOPCENTER = 2
  2468. Global Const PE_GLP_PLACERIGHT = 3
  2469. Global Const PE_GLP_PLACELEFT = 4
  2470.  
  2471. ' legend layout
  2472. '
  2473. Global Const PE_GLL_PERCENTAGE = 0
  2474. Global Const PE_GLL_AMOUNT = 1
  2475. Global Const PE_GLL_CUSTOM = 2   ' for PEGetGraphOptionInfo, do not use in PESetGraphOptionInfo.
  2476.  
  2477. ' bar sizes
  2478. Global Const PE_GBS_MINIMUMBARSIZE = 0
  2479. Global Const PE_GBS_SMALLBARSIZE = 1
  2480. Global Const PE_GBS_AVERAGEBARSIZE = 2
  2481. Global Const PE_GBS_LARGEBARSIZE = 3
  2482. Global Const PE_GBS_MAXIMUMBARSIZE = 4
  2483.  
  2484. ' mmm, pie sizes
  2485. Global Const PE_GPS_MINIMUMPIESIZE = 64
  2486. Global Const PE_GPS_SMALLPIESIZE = 48
  2487. Global Const PE_GPS_AVERAGEPIESIZE = 32
  2488. Global Const PE_GPS_LARGEPIESIZE = 16
  2489. Global Const PE_GPS_MAXIMUMPIESIZE = 0
  2490.  
  2491. ' detached pie slice
  2492. Global Const PE_GDPS_NODETACHMENT = 0
  2493. Global Const PE_GDPS_SMALLESTSLICE = 1
  2494. Global Const PE_GDPS_LARGESTSLICE = 2
  2495.  
  2496. ' marker sizes
  2497. Global Const PE_GMS_SMALLMARKERS = 0
  2498. Global Const PE_GMS_MEDIUMSMALLMARKERS = 1
  2499. Global Const PE_GMS_MEDIUMMARKERS = 2
  2500. Global Const PE_GMS_MEDIUMLARGEMARKERS = 3
  2501. Global Const PE_GMS_LARGEMARKERS = 4
  2502.  
  2503. ' marker shapes
  2504. Global Const PE_GMSP_RECTANGLESHAPE = 1
  2505. Global Const PE_GMSP_CIRCLESHAPE = 4
  2506. Global Const PE_GMSP_DIAMONDSHAPE = 5
  2507. Global Const PE_GMSP_TRIANGLESHAPE = 8
  2508.  
  2509. ' chart color
  2510. Global Const PE_GCR_COLORCHART = 0
  2511. Global Const PE_GCR_BLACKANDWHITECHART = 1
  2512.  
  2513. ' chart data points
  2514. Global Const PE_GDP_NONE = 0
  2515. Global Const PE_GDP_SHOWLABEL = 1
  2516. Global Const PE_GDP_SHOWVALUE = 2
  2517.  
  2518. ' number formats
  2519. Global Const PE_GNF_NODECIMAL = 0
  2520. Global Const PE_GNF_ONEDECIMAL = 1
  2521. Global Const PE_GNF_TWODECIMAL = 2
  2522. Global Const PE_GNF_CURRENCYNODECIMAL = 3
  2523. Global Const PE_GNF_CURRENCYTWODECIMAL = 4
  2524. Global Const PE_GNF_PERCENTNODECIMAL = 5
  2525. Global Const PE_GNF_PERCENTONEDECIMAL = 6
  2526. Global Const PE_GNF_PERCENTTWODECIMAL = 7
  2527.  
  2528. ' viewing angles
  2529. Global Const PE_GVA_STANDARDVIEW = 1
  2530. Global Const PE_GVA_TALLVIEW = 2
  2531. Global Const PE_GVA_TOPVIEW = 3
  2532. Global Const PE_GVA_DISTORTEDVIEW = 4
  2533. Global Const PE_GVA_SHORTVIEW = 5
  2534. Global Const PE_GVA_GROUPEYEVIEW = 6
  2535. Global Const PE_GVA_GROUPEMPHASISVIEW = 7
  2536. Global Const PE_GVA_FEWSERIESVIEW = 8
  2537. Global Const PE_GVA_FEWGROUPSVIEW = 9
  2538. Global Const PE_GVA_DISTORTEDSTDVIEW = 10
  2539. Global Const PE_GVA_THICKGROUPSVIEW = 11
  2540. Global Const PE_GVA_SHORTERVIEW = 12
  2541. Global Const PE_GVA_THICKSERIESVIEW = 13
  2542. Global Const PE_GVA_THICKSTDVIEW = 14
  2543. Global Const PE_GVA_BIRDSEYEVIEW = 15
  2544. Global Const PE_GVA_MAXVIEW = 16
  2545.  
  2546. Type PEGraphOptionInfo
  2547.     StructSize As Integer
  2548.  
  2549.     graphColour As Integer      ' PE_GCR_*, PE_UNCHANGED for no change
  2550.         
  2551.     ShowLegend As Integer       ' BOOL, PE_UNCHANGED for no change
  2552.     legendPosition As Integer   ' PE_GLP_*, if showLegend == 0, means no legend
  2553.  
  2554. ' pie charts and doughut charts
  2555.     pieSize As Integer  ' PE_GPS_*, PE_UNCHANGED for no change
  2556.     detachedPieSlice As Integer ' PE_GDPS_* or PE_UNCHANGED for no change
  2557.  
  2558. ' bar chart
  2559.     barSize As Integer  ' PE_GBS_*, PE_UNCHANGED for no change
  2560.     VerticalBars As Integer     ' BOOL, PE_UNCHANGED for no change
  2561.  
  2562. ' markers (used for line and bar charts)
  2563.     markerSize As Integer       ' PE_GMS_*, PE_UNCHANGED for no change
  2564.     markerShape As Integer      ' PE_GMSP_*, PE_UNCHANGED for no change
  2565.  
  2566. ' data points
  2567.     dataPoints  As Integer      ' PE_GDP_*, PE_UNCHANGED for no change
  2568.     dataValueNumberFormat As Integer    ' PE_GNF_*, PE_UNCHANGED for no change
  2569. ' 3d
  2570.     viewingAngle As Integer     ' PE_GVA_*, PE_UNCHANGED for no change
  2571.  
  2572.     legendLayout As Integer     ' PE_GLL_*
  2573. End Type
  2574.  
  2575. Global Const PE_SIZEOF_GRAPH_OPTION_INFO = (14 * PE_WORD_LEN)
  2576.  
  2577.  
  2578. Declare Function PEGetGraphOptionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, graphOptionInfo As PEGraphOptionInfo) As Integer
  2579. Declare Function PESetGraphOptionInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, graphOptionInfo As PEGraphOptionInfo) As Integer
  2580.  
  2581. ' graph axes
  2582. Global Const PE_GGT_NOGRIDLINES = 0
  2583. Global Const PE_GGT_MINORGRIDLINES = 1
  2584. Global Const PE_GGT_MAJORGRIDLINES = 2
  2585. Global Const PE_GGT_MAJORANDMINORGRIDLINES = 3
  2586.  
  2587. ' axis division method
  2588. Global Const PE_ADM_AUTOMATIC = 0
  2589. Global Const PE_ADM_MANUAL = 1
  2590.  
  2591. Type PEGraphAxisInfo
  2592.     StructSize As Integer
  2593.  
  2594.     groupAxisGridLine As Integer        ' PE_GGT_*, PE_UNCHANGED for no change
  2595.     dataAxisYGridLine As Integer        ' PE_GGT_*, PE_UNCHANGED for no change
  2596.     dataAxisY2GridLine As Integer       ' PE_GGT_*, PE_UNCHANGED for no change
  2597.     seriesAxisGridline As Integer       ' PE_GGT_*, PE_UNCHANGED for no change
  2598.  
  2599.     dataAxisYMinValue As Double
  2600.     dataAxisYMaxValue As Double
  2601.     dataAxisY2MinValue As Double
  2602.     dataAxisY2MaxValue As Double
  2603.     seriesAxisMinValue As Double
  2604.     seriesAxisMaxValue As Double
  2605.  
  2606.     dataAxisYNumberFormat As Integer    ' PE_GNF_*, PE_UNCHANGED for no change
  2607.     dataAxisY2NumberFormat As Integer   ' PE_GNF_*, PE_UNCHANGED for no change
  2608.     seriesAxisNumberFormat As Integer   ' PE_GNF_*, PE_UNCHANGED for no change
  2609.  
  2610.     dataAxisYAutoRange As Integer       ' BOOL, PE_UNCHANGED for no change
  2611.     dataAxisY2AutoRange As Integer      ' BOOL, PE_UNCHANGED for no change
  2612.     seriesAxisAutoRange As Integer      ' BOOL, PE_UNCHANGED for no change
  2613.  
  2614.     dataAxisYAutomaticDivision As Integer       ' PE_ADM_* or PE_UNCHANGED for no change
  2615.     dataAxisY2AutomaticDivision As Integer      ' PE_ADM_* or PE_UNCHANGED for no change
  2616.     seriesAxisAutomaticDivision As Integer      ' PE_ADM_* or PE_UNCHANGED for no change
  2617.  
  2618.     dataAxisYManualDivision As Long     ' if dataAxisYAutomaticDivision is PE_ADM_AUTOMATIC, this field is ignored
  2619.     dataAxisY2ManualDivision As Long    ' if dataAxisY2AutomaticDivision is PE_ADM_AUTOMATIC, this field is ignored
  2620.     seriesAxisManualDivision As Long    ' if seriesAxisAutomaticDivision is PE_ADM_AUTOMATIC, this field is ignored
  2621.  
  2622.     dataAxisYAutoScale As Integer       ' BOOL, PE_UNCHANGED for no change
  2623.     dataAxisY2AutoScale As Integer      ' BOOL, PE_UNCHANGED for no change
  2624.     seriesAxisAutoScale As Integer      ' BOOL, PE_UNCHANGED for no change
  2625. End Type
  2626.  
  2627. Global Const PE_SIZEOF_GRAPH_AXIS_INFO = (5 * PE_WORD_LEN) + (6 * PE_DOUBLE_LEN) + (9 * PE_WORD_LEN) + (3 * PE_LONG_LEN) + (3 * PE_WORD_LEN)
  2628.  
  2629.  
  2630. Declare Function PEGetGraphAxisInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, graphAxisInfo As PEGraphAxisInfo) As Integer
  2631. Declare Function PESetGraphAxisInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, ByVal sectionN As Integer, ByVal GraphN As Integer, graphAxisInfo As PEGraphAxisInfo) As Integer
  2632.  
  2633. ' Subreport(s)
  2634. Declare Function PEOpenSubreport Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal parentJob%, ByVal subreportName$) As Integer
  2635. Declare Function PECloseSubreport Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer
  2636.  
  2637. ' Formula Syntax
  2638.  
  2639. Global Const PE_FS_SIZE = 2
  2640.  
  2641. ' Syntax Types
  2642. Global Const PE_FST_CRYSTAL = 0
  2643. Global Const PE_FST_BASIC = 1
  2644.  
  2645. Type PEFormulaSyntax
  2646.     StructSize As Integer               ' Set to PE_SIZEOF_FORMULA_SYNTAX
  2647.     FormulaSyntax(0 To 1) As Integer    ' PE_FS_* or PE_UNCHANGED.
  2648. End Type
  2649.  
  2650. Global Const PE_SIZEOF_FORMULA_SYNTAX = (3 * PE_WORD_LEN)
  2651.  
  2652. ' PESetFormulaSyntax
  2653. ' Use this API to set the syntax to use in the next (and all successive)
  2654. ' formula API call(s).
  2655. ' Set one of PE_FST_* into formulaSyntax[0];
  2656. ' formulaSyntax[1] is reserved for internal use.
  2657. ' ***Default Behaviour: If any Formula API is called before calling
  2658. '                      PESetFormulaSyntax then PE_FST_CRYSTAL is assumed.
  2659. Declare Function PESetFormulaSyntax Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, FormulaSyntax As PEFormulaSyntax) As Integer
  2660.  
  2661. ' PEGetFormulaSyntax
  2662. ' Indicates the syntax used by the formula addressed in the last formula API call.
  2663. ' The syntax type is returned in formulaSyntax[0];
  2664. ' formulaSyntax[1] is reserved for internal use.
  2665. ' ***Default Behaviour: If this API is called before any Formula API is called
  2666. '                       then the values returned will be PE_UNCHANGED.
  2667. Declare Function PEGetFormulaSyntax Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob As Integer, FormulaSyntax As PEFormulaSyntax) As Integer
  2668.  
  2669.  
  2670. ' ************************************************************************
  2671. ' New Types and Functions
  2672.  
  2673. ' Get Report Version
  2674. Type PEVersionInfo
  2675.     StructSize As Integer ' initialize to PE_SIZEOF_VERSION_INFO
  2676.     major As Integer
  2677.     minor As Integer
  2678.     letter As String
  2679. End Type
  2680.  
  2681. Global Const PE_SIZEOF_VERSION_INFO = (4 * PE_WORD_LEN)
  2682.  
  2683. Declare Function PEGetReportVersion Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, pVersionInfo As PEVersionInfo) As Integer
  2684.  
  2685.  
  2686. ' Report Alerting
  2687. Type PEReportAlertInfo
  2688.     StructSize As Integer       ' initialized to be PE_SIZEOF_REPORT_ALERT_INFO
  2689.     nameLength As Integer
  2690.     name As Long                ' NOTE: must release HANDLEs even not using them
  2691.     isEnabled As Integer        ' TRUE if alert is enabled, else FALSE
  2692.     alertConditionLength As Integer
  2693.     alertConditionFormula As Long
  2694.     nTriggeredInstances As Long ' the number of times the alert was triggered
  2695.     alertMessageLength As Integer
  2696.     defaultAlertMessageLength As Integer
  2697.     alertMessageFormula As Long
  2698.     defaultAlertMessage As Long
  2699. End Type
  2700.  
  2701. Global Const PE_SIZEOF_REPORT_ALERT_INFO = (6 * PE_WORD_LEN) + (5 * PE_LONG_LEN) ' (sizeof (PEReportAlertInfo))
  2702.  
  2703. Type PEAlertInstanceInfo
  2704.     StructSize As Integer   ' initialized to be PE_SIZEOF_ALERT_INSTANCE_INFO
  2705.     alertMessageLength As Integer
  2706.     alertMessage As Long
  2707. End Type
  2708.  
  2709. Global Const PE_SIZEOF_ALERT_INSTANCE_INFO = (2 * PE_WORD_LEN) + (1 * PE_LONG_LEN) '(sizeof (PEAlertInstanceInfo))
  2710.  
  2711. Declare Function PEGetNReportAlerts Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%) As Integer 'return -1 if failed.
  2712.  
  2713. Declare Function PEGetNthReportAlert Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal alertN%, reportAlertInfo As PEReportAlertInfo) As Integer
  2714.  
  2715. Declare Function PEGetNthAlertInstanceInfo Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal alertN%, ByVal instanceN As Long, alertInstanceInfo As PEAlertInstanceInfo) As Integer
  2716.  
  2717. Declare Function PESetNthAlertConditionFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal alertN%, formula As String) As Integer
  2718.  
  2719. Declare Function PESetNthAlertMessageFormula Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal alertN%, formula As String) As Integer
  2720.  
  2721. Declare Function PESetNthAlertDefaultMessage Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal alertN%, text As String) As Integer
  2722.  
  2723. Declare Function PEEnableNthAlert Lib "\Program Files\Common Files\Crystal Decisions\2.0\bin\crpe32.dll" (ByVal printJob%, ByVal alertN%, enabled As Integer) As Integer
  2724.  
  2725. ' END new
  2726. '************************************************************************
  2727.  
  2728. Function PE_SECTION_CODE(sectionType%, groupN%, sectionN%) As Integer
  2729. ' A function to create section codes:
  2730. ' (This representation allows up to 25 groups and 40 sections of a given
  2731. ' type, although Crystal Reports itself has no such limitations.)
  2732.     PE_SECTION_CODE = (((sectionType) * 1000) + ((groupN) Mod 25) + (((sectionN) Mod 40) * 25))
  2733. End Function
  2734.  
  2735. Function PE_AREA_CODE(sectionType%, groupN%) As Integer
  2736. 'A function to create area codes:
  2737.     PE_AREA_CODE = PE_SECTION_CODE(sectionType, groupN, 0)
  2738. End Function
  2739.  
  2740. Function PE_GROUP_N(sectionCode%) As Integer
  2741. ' Function to decode Group Number from section codes:
  2742.     PE_GROUP_N = ((sectionCode) Mod 25)
  2743. End Function
  2744.  
  2745. Function PE_SECTION_N(sectionCode) As Integer
  2746. ' Function to decode Section Number from section codes:
  2747.    PE_SECTION_N = (((sectionCode \ 25) Mod 40))
  2748. End Function
  2749.  
  2750. Function PE_SECTION_TYPE(sectionCode%) As Integer
  2751. ' Function to decode type from section codes:
  2752.     PE_SECTION_TYPE = ((sectionCode) \ 1000)
  2753. End Function
  2754.  
  2755. 'Function to simplify PEGetVersion
  2756. Function PEVBGetVersion(ByVal component%) As Single
  2757.     Dim version As Integer
  2758.     Dim major As Integer
  2759.     Dim minor As Integer
  2760.     version = PEGetVersion(component)
  2761.     If version = 0 Then
  2762.         PEVBGetVersion = 0
  2763.     Else
  2764.         major = version / 256
  2765.         minor = version Mod 256
  2766.         PEVBGetVersion = major + (minor / 10)
  2767.     End If
  2768. End Function
  2769.  
  2770.  
  2771. Function PEGetJobStatus(ByVal job As Integer, Info As PEJobInfo) As Integer
  2772. ' To work around the problem of 4 - Byte alignment the PEGetJobStatus
  2773. ' call has been re-declared here. When your application calls PEGetJobStatus
  2774. ' it is calling this function which in turn calls CRPE32.DLL.
  2775. Dim splitinfo As SplitPEJobInfo
  2776. Dim temp1 As Long
  2777. Dim temp2 As Long
  2778.  
  2779. splitinfo.StructSize = PE_SIZEOF_JOB_INFO
  2780. PEGetJobStatus = RealPEGetJobStatus(job, splitinfo)
  2781. If PEGetJobStatus <> -1 Then
  2782.     temp1 = splitinfo.NumRecordsRead1
  2783.     If temp1 < 0 Then
  2784.         temp1 = 65536 + temp1
  2785.     End If
  2786.     temp2 = splitinfo.NumRecordsRead2
  2787.     If temp2 < 0 Then
  2788.         temp2 = 65536 + temp2
  2789.     End If
  2790.     temp2 = temp2 * 65536
  2791.     Info.NumRecordsRead = temp1 + temp2
  2792.     
  2793.     temp1 = splitinfo.NumRecordsSelected1
  2794.     If temp1 < 0 Then
  2795.         temp1 = 65536 + temp1
  2796.     End If
  2797.     temp2 = splitinfo.NumRecordsSelected2
  2798.     If temp2 < 0 Then
  2799.         temp2 = 65536 + temp2
  2800.     End If
  2801.     temp2 = temp2 * 65536
  2802.     Info.NumRecordsSelected = temp1 + temp2
  2803.     
  2804.     temp1 = splitinfo.NumRecordsPrinted1
  2805.     If temp1 < 0 Then
  2806.         temp1 = 65536 + temp1
  2807.     End If
  2808.     temp2 = splitinfo.NumRecordsPrinted2
  2809.     If temp2 < 0 Then
  2810.         temp2 = 65536 + temp2
  2811.     End If
  2812.     Info.NumRecordsPrinted = temp1 + temp2
  2813.     Info.LatestPageN = splitinfo.LatestPageN
  2814.     Info.StartPageN = splitinfo.StartPageN
  2815.     Info.DisplayPageN = splitinfo.DisplayPageN
  2816.     Info.PrintEnded = splitinfo.PrintEnded
  2817. End If
  2818. End Function
  2819.  
  2820.  
  2821.  
  2822. ' End Of Declarations
  2823. '************************************************************************
  2824.